Backups with RSYNC in OS X Tiger

Friday, June 17 2005 @ 12:11 AM EDT

Contributed by: Admin

OS X made a big improvement to some of their command line utilities in OS X 10.4 Tiger. CP, MV, TAR, and RSYNC can handle multipart Mac files with no problem. Read on for an awesome way to back up your files.

rsync, as you might have guessed, is a program to remotely sync files. I won't go over its many options here, I'll just cover one: how to back up files from one machine to another over a network. I'll flesh this out later, but for now, here's the basics.

Running the same rsync command over and over (say, each night at 4am) will copy only files that are new or have changed. But, it won't delete old files on the backup server if you've deleted them from your main machine. You say you accidentally deleted something that was on your desktop a week ago? It'll be on the backup server, no matter how many times you've run rsync in the meantime. Is that cool or what?

Update: according to this, you need to say '-E' for rsync to copy resource forks in Tiger. For non-Tiger users, look at RsyncX to save your resource forks, but note that you'll need it installed on both Macs.

Update 2: MacDevCenter has created a whole article on backing up with rsync. It uses iCal to schedule an AppleScript, and of course using a shell script and cron would be much neater (doesn't need to do anything special to handle output and messages; doesn't require iCal to be running--hell, doesn't even require anyone to be logged in!) but it's a good overview and it has lots of good info in the comments.

1 comments



http://apple.newbox.org/article.php?story=osx_rsync