View Full Version : AppleScript To Backup To External HD
Mar 8, 2007, 05:03 PM
Can someone please give me an AppleScript that will backup my Home folder onto a backup folder I made on my External HD?
Mar 9, 2007, 10:21 AM
You may want to look into Carbon Copy Cloner (http://www.bombich.com/software/ccc.html) instead.
Mar 9, 2007, 05:37 PM
I have used CCC before and really didn't have a great experience with it. Do you know of any other solutions besides CCC? I would like it to atleast be an AppleScript.
Mar 9, 2007, 06:40 PM
try Super Duper
Mar 11, 2007, 04:34 PM
I use Intego Personal Backup X4. It does exactly what you described.
Mar 11, 2007, 05:39 PM
You don't need an Apple Script, OS X comes with an old command line utility called rsync. For a really basic backup, just run "rsync -a /Users/username /Volumes/externalharddrivename/" in your terminal.
Note the lack of a trailing / on the first path, this is important. A trailing / means "the contents of" rather than the folder itself. So with a trailing /, all of the contents of your home folder would be dumped onto the root of the external hard drive, without a copy of the folder itself.
Run the same command again, and only the files that have changed will be moved. By default, files you've deleted in your home folder will not be removed from the backup, add "--delete" right after the "-a" if you want deleted files to be removed from your home folder. rsync is very powerful, if you want more information, run "man rsync" in your terminal.
Mar 11, 2007, 08:34 PM
It's trivial. Just one line.
But don't copy your data to an external drive use "rsync". It will copy over only the files that have changed since the last time you sync'd. It will go much faster. It is the one line script:
rsync ~username /Volumes/mydisk
Of course you need to replace "username" and "mydisk" with real names. If you want to automate this to run say ever night then you can give the name of your backup script to "crontab".
For more info, from the terminal type "man rsync" and "man crontab". If you read up you will see that rsync is pretty smart and can "sync" data over a network or across the Internet if you ask it to. But going to an external drive is easy.
Mar 20, 2007, 06:07 AM
Rsync indeed is a very reliable solution - try my AppleScript as frontend for rsync. It's nice cause you can output stats to growl.
Use it in combination with "Do something when". Just follow the instructions on my page.
Hope that helps.
PS. I'm working on a more sophisticated version which should be easier to handel..