The Wonders of rsync

| |

I have to admit that, until recently, I've been negligent in my backup plan. Oh, I did the occasional database backup and have most of my files replicated on my local drive, but I didn't have a real plan. If disaster had struck I wouldn't have been prepared.

I've known about rsync for a while now, but I never got around to experimenting with it that much. When I decided to start regular automated backups I knew that incremental was the way to go. Downloading my entire server to my local machine everynight just wouldn't cut it. Fortunately rsync provided the perfect solution.

What surprised me the most was how quickly rsync analyzed and copied my files. A few hundred megabytes and more than a thousand files were downloaded in less than 10 minutes! And after that first synchronization each of the daily backups goes even faster. That's what I call a great program. It has greatly exceeded my expectations.

I'm using rsync from the command line for the website and running it over ssh. I won't do a full how to, but here's an example of how I'm using it.

rsync -ahrvz --exclude-from=laf_backup.exclude [email protected]:~/httpdocs /media/sdb1/Backup/website

The exclude file is used to block specified files or directories from the backup. The first specified directory is the source and the latter is the destination directory.

Of course there are other ways to use rsync. My previous blog talked about Smb4K using rsync to synchronize local and shared drives. There are also front ends like Grsync and QSync. Whatever interface type you prefer, rsync is a program worth giving a try. You won't be disappointed.