I would like to get some opinions on a backup method using rsync. I already have a script written to mirror the data over to a backup script from a cron that is run every night. I've also been tempted to use the "--delete" option to keep everything up to date on the backup server. However, this is probably a bad idea in the event my data is deleted from the "/home" directory (just as an example) before the cron runs. When the cron runs and this isn't noticed before hand, the "/home" directory on the backup server will probably be whiped out as well, correct? So, do all you that use rsync as a backup method not use the "--delete" option, or do you keep maybe a separate weekly backup safe somewhere else. Of course, we do have our data center making tape backups of the backup server as well, but let's assume we didn't. Thank you!
Eric, I'm going to use this opportunity to shamelessly plug my website: http://www.mikerubel.org/computers/rsync_snapshots/ By keeping multiple rotating backup "snapshots", you can protect yourself should one or more of them get hosed, and you still won't need a huge amount of extra storage. All you need are rsync and cp. Mike> I would like to get some opinions on a backup method using rsync. I already > have a script written to mirror the data over to a backup script from a cron > that is run every night. I've also been tempted to use the "--delete" > option to keep everything up to date on the backup server. However, this is > probably a bad idea in the event my data is deleted from the "/home" > directory (just as an example) before the cron runs. When the cron runs and > this isn't noticed before hand, the "/home" directory on the backup server > will probably be whiped out as well, correct? So, do all you that use rsync > as a backup method not use the "--delete" option, or do you keep maybe a > separate weekly backup safe somewhere else. Of course, we do have our data > center making tape backups of the backup server as well, but let's assume we > didn't. Thank you!
I'd suggest you proceed with caution. I had implemented rsync as a backup solution until I found out that it dies if you try to backup files that get moved. (So if a user moves/deletes a file while your backup is running, it'll fail.) It is, however, great for static files.> I would like to get some opinions on a backup method using rsync. I > already have a script written to mirror the data over to a backup > script from a cron that is run every night. I've also been tempted to > use the "--delete" option to keep everything up to date on the backup > server. However, this is probably a bad idea in the event my data is > deleted from the "/home" directory (just as an example) before the cron > runs. When the cron runs and this isn't noticed before hand, the > "/home" directory on the backup server will probably be whiped out as > well, correct? So, do all you that use rsync as a backup method not > use the "--delete" option, or do you keep maybe a separate weekly > backup safe somewhere else. Of course, we do have our data center > making tape backups of the backup server as well, but let's assume we > didn't. Thank you!-- John Madden UNIX Systems Engineer Ivy Tech State College jmadden@ivy.tec.in.us
Be aware that with any "live" backup solution your backup directory may be corrupt in subtle ways. We've been running rsync for years now to back up Windows files stored on our Samba server, and we often find files on the backup destination that have the identical date and time stamp as the source but different content. I suspect that, since Unix only records file times to the second (and Windows only to every two seconds), a file was being changed while rsync was reading it. Rsync copied the data from the file and, in the same second, the user overwrote part of the file with new data. The result - two files that have the same size, date, and time but different data. Unless you call rsync with the --ignore-times option next time, this error will go undetected by subsequent rsync runs. -- -IAN! Ian! D. Allen Ottawa, Ontario, Canada idallen@ncf.ca Home Page on the Ottawa FreeNet: http://www.ncf.ca/~aa610/ College professor at: http://www.algonquincollege.com/~alleni/ Board Member, TeleCommunities CANADA http://www.tc.ca/