Rsync is a command line utility traditionally used in synchronizing files between two computers, but rsync can also be used as an effective backup tool. This article explain how to use rsync to backup your computer to a drive attached to your system. You can use a removable drive, such as an external USB hard drive, so that you can store the backups in a safe place away from your working environment.
🙂
Yup, good to see this sort of thing on osnews. High quality, useful article.
nice =:D
i have used rsync before, but this is a very good article
Thank you for the link.
The code of the scripts is not so great, IMHO.
# increment backups, rotate oldest backup to todays
mv yesterday day3
mv today yesterday
mv oldest today
In this case, e.g., I do not see the use to rotate the files. Your oldest file could be deleted and you could rsync against the newest file in order to have a minimal number of updates
I would go for this
rm -f day3
mv yesterday day3
cp today yesterday
rsync …
Moreover, I would like to see the author go into rsync’ing portables that are not on the lan and so.
It’s a good starter, this article.
Greetings all,
For the purposes of backup you might like to check out rdiff-backup at
http://rdiff-backup.stanford.edu/
it works like rsync and also does ‘reverse diffs’ which can help to keep the size of your backups down. We use it to backup our server onto another machine and it works fantastically.
Cheers,
Mike
Very nice and helpfull article. Will definitely try out the script.
There’s many articles over the net which explains how to backup files, but I never found an articles about “what to backup”.
Backuping all /home, /etc and /boot seems overkills for me.
We’ve been doing this for quite a while, and very handy it is to. The inspiration (and backbone) of ours however came from http://www.mikerubel.org/computers/rsync_snapshots/
Nice article. Would have been even better if it would mention a strategy to restore back-ups.
Could rsync be used to back up the Home/Documents folder on an OSX machine and synchronise it with the My Documents folder on a Windows box, using the diffs feature to only copy across files where the local copy is more recent than the Windows-held copy ?
Thanks for the link! I’ve been tarring off my ~ and copying it to my thumbdrive, but have been wanting to try out rsync. Perfect timing.
You may want to try Unison for this purpose (cross-sync of data repositories).
Unison: http://www.cis.upenn.edu/~bcpierce/unison/
Just like Mike Reid said. It avoids the need to do what vindevogel said, too, while saving space in the process.
I wrote a little rdiff-backup article a while ago:
http://www.pycs.net/lateral/stories/26.html
More 🙂
As always, a backup article that only explains how to do backup, but not a restore example. It’s only half the story.
If you are using kde and look for a nice backup and restore tool with an good documented gui, I suggest kdar (http://kdar.sourceforge.net/).
I’ve used it both to store files on zip, cdrw and a spare hard disk. Easy to use and can compress with gzip and bzip2, and split the files over different disks.
It is simple to use and I’ve been very pleased with it.
Rsync on the other hand is perfect to keep my desktop and laptop synchronized, thank you!
unison file synchronizer has far more better characteristics than rsync.
http://www.cis.upenn.edu/~bcpierce/unison/
unison is based on a replication algorithm, so we no longer need to know source or destination. Just run it.
It is also resilient failure, which means that you can stop its execution any time and resume many times.
KFS (K File Synchronizer) is the easiest to use file backup and synchronization tool available. Its GUI is intuitive and powerful with options for local files, smb, nsf, sftp, etc.
Enjoy
Here’s a similar article which has a more effecient method for using rsync to do backup.
http://linuxfocus.org/English/March2004/article326.shtml
nice app thank you 🙂
I have made a small script that takes a snapshot of my cvs-repositories.. and locks the repository, to prevent disasters in case one is commiting while the cronjob is running.
It keeps the lastest 5 days backups and does rsync with remote server too.
http://rubyforge.org/frs/download.php/1374/backup_repository-0.1.ta…
—
Simon Strandgaard
I use this tool myself to do automatic backups of web sites & data from a public server to a private server here in-house.
Set this up w/ a cron daemon and life is good.
Go ahead HD, crap out, make my day!
What’s really cool is it copies newer files and avoids those that haven’t been updated, great for replication…
thanks, was wondering about sys backups and just created my own script cheers for article
Would not the restore be very simple if you backed up to a hot swappable hard drive on the same machine? IDE hard drives are so cheap that this is a realistic option. Main hard drive failure or unrecoverable file corruption, just pull the drive and connect the last day’s backup drive. It’s a mirror as at the time of the last backup. Only data lost is whatever changed after the backup and before the failure. What about the MBR, however. Is that backed up by rsync? Or would you have to configure the replacement drive somehow before it would boot? I don’t know the answers to these questions.
A nice backup tool based on rsync is BackupPC http://backuppc.sourceforge.net/ . It supports Windows and Linux computers, allows multiple full/incremental snapshots per computer, and is driven by a simple web interface.
While I’ve seen some plugs for other backup tools here, I have to suggest rsnapshot as well (http://rsnapshot.org). It is basically a perl script that uses rsync like this article but more thought out. It does really nice incremental backups. It also works via ssh or samba.
The article is very informative.
This is a big chance for distributions. There are so many possibilities under Linux and I think distros should investigate them providing graphical tools that do this kind of things. For example a distro that have a graphical backup and restore tool would definitely win thousands of users over other distros imho.
Thanks for the article again.
“As always, a backup article that only explains how to do backup, but not a restore example. It’s only half the story.”
One of the great things about rsync is that you can just
cp -a /source /target
Plain rsync is perfect for mirrors, but for serious backups you need point-in-time restoration such as provided by tape rotation. That is what rdiff-backup provides with an interface as easy and as universal as rsync for both backup and restoration. On top of that, the use of symlinks for incremental backups saves disk space while keeping everything unix simple.
http://rdiff-backup.stanford.edu/