Daily Backup Archive

A quick question about the Daily Backup Archive script. The script runs fine and the zipped database ends up in ~/Backup. Is it possible to tell the script to zip and save the database to a specific drive (e.g. an external hard disk)? I use Time Machine for backups and regularly clone my boot disk to two separate external drives in different locations, but would like to add another layer of protection for my DTPO databases.

Kinsey

Open Script icon menu > Open Scripts Folder > Export > Daily Backup Archive.scpt.

You need to replace “~/Backup” with the POSIX path to the desired location.

I havn’t got the script "Daily Backup Archive.scpt.” :frowning: Anywhere I can find it? Cheers.

Here you go.
Daily backup archive.scpt.zip (4.51 KB)

You’re a gent! Regards.

Been thinking about this, wouldn’t it be great if this script would run automatically on any open databases, if there be any, when you colse dowm your computer? Any thoughts as whether or not you think this is a good idea and, perhaps more importantly, how this could be achieved? [Note to Bluefrog: BTW I have managed to adapt the script to send xip to external drive :slight_smile: :slight_smile: :slight_smile: ]

(Congrats! :smiley: )

Could it be written to do this on machine shutdown? Yes, but it wouldn’t be simple, and you’d also have to reopen DEVONthink if it wasn’t open (and please don’t tell me you shut down your machine with apps running. Ugh!! Don’t get me started!). Reopening DEVONthink could trigger new Sync operations if people have them set to Sync on database open. etc., etc.

So possible? Sure. Many things are possible. But there are many things to consider here.

I do not admit to anything! But when you say, "and please don’t tell me you shut down your machine with apps running. Ugh!! Don’t get me started!” are there important reasons for this or is it your preference?

I get flack from people over this, as if I’m just an old hold-out, but truly - it is always a better idea to shut down apps yourself. How do you know if everything shut down nice and tidily otherwise? Shutting things down yourself, you can catch a hung process or see something crashing right then. Even if you don’t deal with it right then, at least you can say, “Huh… I had to Force Quit Safari when I was doing my shutdown. Wonder what’s up with that.”

It’s the same thing with startup items. People want to have everything open on startup, especially things with network access. But if there’s a volume unavailable, etc. it will stall your startup too. Also, if you have 20 apps all launching on boot and something goes wrong on your machine, one of the first things suggested is to reboot clean (ie. remove startup items). It’s no fun guessing which app it might be. If there’s a problem on my machine, it will happen after I’ve purposefully launched an app or three. That’s much easier to troubleshoot (for you and for Support).

PS: I am also a big fan of doing an occasional machine reboot, even if it’s just once a week. It’s good for the machine, I promise.

There are many techniques to run a script at shutdown, and I don’t recommend any of them. The shutdown process on OS X is increasingly complex and adding your own process to the mix is fraught. Sometimes your process will execute correctly, sometimes the OS X shutdown process will get irritated and maybe terminate your process early. Just not worth the hassle.

The better approach, I think, is to use Automator and create a “Calendar Alarm”. These can be quite sophisticated, but basically you schedule an event in Calendar, that event triggers an Automator workflow, and that workflow can have steps to run your script and put out a notification message when it is finished. So, you could schedule a script to do the daily backup, for example.

Thanks Bluefrog & Korm for your good advice.

Thanks for the help so far Bluefrog, but I’m afraid you’ve lost me when it comes to changing the POSIX path of the script from '~/Backup" to the desired location. How does one do that?!

The easiest way is to open the script in Script Editor, delete “~/Backup” leaving the quotes, find the location in a Finder window, and drag it into the script between the quotes. This will drop the POSIX (UNIX slash-style) path into the script. Cheers!