rsnapshot: rsync-Based Filesystem Snapshot

by Juliet Kemp

Tip of the Trade: Snapshot filesystems may be great, but migrating to a new filesystem is a major deal. If you're not up for it, rsnapshot makes achieving snapshot-like functionality a snap.

Juliet Kemp
Snapshot filesystems, which offer instant-availability backups from multiple time points, are a great idea. But migrating to a new filesystem is a major deal. rsnapshot works on an ext3 filesystem, using rsync and hard links to create something that looks and works like multiple instant-availability full backups (as with a snapshot system), but that takes up the space of only one full backup plus incremental changes.

That "full backup space" is of course still the gotcha — basically, you'll need a spare disk. However, external disks are increasingly cheap; and rsnapshot can be used remotely with ssh. So you could use one large central disk to keep snapshots of your most important data from multiple clients.

rsnapshot is relatively easy to configure. Check /etc/rsnapshot.conf for the minor edits needed (make sure to uncomment the "interval" lines), then try a test run from the command line with rsnapshot hourly. The interval names don't actually matter; they're just used to define how many snapshots of each type are kept. The actual run intervals are defined using the crontab — a reasonable crontab example is provided.

The first run may take a while (as always with a first run of rsync). Subsequent runs will be much faster as the files are updated from the snapshot. Usefully, it's possible to set it up so any user can pull his or her own backups, rather than relying on root access — thus minimizing your work later on!

rsnapshot should run on nearly any Unix-type system (requiring only perl and rsync), and is available as a package for most of the major Linuxes.

This article was originally published on Monday Aug 25th 2008
Mobile Site | Full Site