grsync – a great backup and file sync tool

grsync_maingrsync_aboutGreetings everyone, I am back with more information about backing up your files.  I know, I know, talking about backups might be boring, but one day a good backup will save your butt, I guarantee it.  Previously I posted an article extolling the virtues of rsync, a very powerful command line tool for syncing files both locally and across networks via SSH.  This is great for command line addicts like myself, and especially because you can use it in scripts such that along with shared keys and keychain it becomes a powerful tool in your arsenal of sysadmin goodies.

Now, for folks that aren’t command like geeks, or maybe just want a quick and easy way to backup some files, there is a nifty little tool called grsync.  This is (as you can probably guess from the name) a gui for the command line rsync, making it much more user friendly.  Also, it’s quite nice for pointing and clicking what you want, and then seeing what the command it will use is, a learning tool.

The home of grsync is here:

http://www.opbyte.it/grsync/

For Debian, Ubuntu users you can find it in the repositories.

Rsync R Your Friend

Need to sync some files? Locally or remotely? How about re-thinking an old friend, rsync?

You may be like I was, and have discounted rsync for a long time due to the security risk imposed by running the “r” daemon on your servers. Guess what? You can not only use rsync to sync up local directories on the same server (this can be real handy for backups), but you can also sync from one server to another via SSH rather than the rsync daemon. This would be much like scp, only you can sync whole directory trees.

So. Let’s say you want to sync two local directories, how would you do that? Well, if we are syncing /export/datadir to /export/backupdir it would look something like this:

rsync -aruv /export/datadir/ /export/backupdir/

It’s just that easy. Now, those command line switches, what do they do? Check it out:

a = archive
r = recursive
u = skip files that are newer on the receiving end
v = verbose, tell me what's going on

There is another one that is good when syncing between two separate servers, and that is the “z” switch. This tells rsync to use compression during the file transfer thus saving bandwidth. Let’s see what the above would look like from one server to another, as if you are running the command from the server you are syncing to:

rsync -aruvhz --progress server1:/export/datadir/ /export/backupdir/

There are a couple other options there, did you notice? I have added the “h” which tells rsync to output information in human readable format (GB, MB, K, etc), and the –progress which tells rsync to report exactly that, the progress of each transfer. You can use these with local transfers too, mix and match as you see fit.