Rsync copies data to another directory, another disk volume, or another machine. It only copies what needs to be copied; that is, if a file hasn't changed since the last time you backed it up, rsync won't bother copying it again. Even better, if only part of a large file has changed, rsync only copies those bytes.
I don't see any point in calling rsync from Applescript, but if you must, you can. I'd just write a Terminal bash script. For my system, it looks like this:
cd $HOME rsync -av -e ssh . firstname.lastname@example.org:ibook
The 192.168.3.237 is a Linux server. I'm using ssh as the transport protocol. This backs up my home directory to the "ibook" directory under "tonyl"'s account on the Linux box.
If I were backing up to another directory or drive here, I might instead do:
cd $HOME rsync -av . /Otherplace
If I were concerned about including resource forks, I'd add "-E":
rsync -aEv . /Otherplace
Some like to use "-aEv --delete" to remove files on the archive that no longer exist here. I deliberately do not do that. I have plenty of space on the Linux box.
If you must do this with Applescript, use "do shell script", but it's really silly to waste that overhead.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-03-27 Tony Lawrence