Jump to content

Script to shutdown programs before starting backup?


Recommended Posts

Quote:

Is there an Applescript that will shut down all programs that are open before a scheduled backup runs?

 


Two choices: If you REALLY want to "shut down ALL programs", then this one-word AppleScript will do exactly that and power down your computer:

Code:


shutdown

If, instead, you only want to shut down running applications that have been started by the logged-in user, then this one-word AppleScript will do that: Code:
logout

Link to comment
Share on other sites

Code:


shutdown

It's really difficult to perform a backup after that script is (fully) executed. That, of course, violates the intent of the script. wink.gif

 

Years ago, I wrote an application for OS 9 that quit all apps and "ejected" all network volumes in preparation for a backup. It still runs in Classic.

I haven't found any practical use for it under OS X, as the Retro Client runs much better under the pre-emptive multitasking in OS X than the co-operative multitasking under OS 9.

Link to comment
Share on other sites

Quote:

It's really difficult to perform a backup after that script is (fully) executed.

 


Um, I believe that the suggested script meets all of the stated requirements:

Quote:

Is there an Applescript that will shut down all programs that are open before a scheduled backup runs?

 


Admittedly, the answer was a bit tongue-in-cheek, but it did solve the stated problem, and running a backup was not part of the stated requirements. For a better-defined problem, a better solution might exist. Point being, though, in a Unix system with all of its background processes, etc., it's a bit hard to "shut down all programs that are open" except by shutting the system down; othewise, you are trying to back up a live filesystem, which is very difficult if not impossible. See also the discussion in this thread about backing up a live filesystem: Is a Duplicate an Exact Duplicate?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...