1

The setup is a NAS box on a lan mounted as NFS and the source is a laptop running an old kubuntu 10.4. Rsync has to be run as a local file copy, NAS box doesn't support an rsync daemon.

  • How do I fully mirror the linux partition while it's running?
  • Can I exclude any of the root directories safely?
  • Will it be easy to reverse rsync the backup data into the source if source data become corrupt?
  • Will it be easy to reverse rsync the backup data into the source if the source disk fails completely?

So far, my configuration is this:

rsync -vaHAXi --delete --stats --human-readable --progress --log-file=FILE /source /dest/backup
1

How do I fully mirror the linux partition while it's running?

Not the best idea (for many reasons, rsync(1) running out of memory being the main one), but it might be possible.

Can I exclude any of the root directories safely?

Some of them (f.i. /proc) must be excluded, most of the others probably should be backed up.

Will it be easy to reverse rsync the backup data into the source if source data become corrupt?

It depends of what you want to restore. The target of your backup is just a copy of your files. If all you want is to restore some data, you can just copy the relevant directory from your NAS. If on the other hand you want to restore the entire system, you can save yourself a lot of time and pain by choosing another approach.

Will it be easy to reverse rsync the backup data into the source if the source disk fails completely?

Unlikely.

You should consider a different backup policy:

  • Do a full backup of your system once in a while (say every few months, or whatever seems appropriate). rsync(1) is not the right tool for this. Use dump(8) / restore(8) to backup / restore each filesystem, or learn to use a dedicated backup system such as Amanda or Bacula. Try it with a smaller filesystem first, and make sure to practice both backup and restore. Carefully take notes of the process. It's too late to learn how to do it while your system has failed.
  • Do separate backups of your data every few days (or, again, whatever is appropriate for you). rsync(1) is perfect for that, and something like Grsync might make your life easier (you can f.i. define separate backup sets). When you're comfortable with how things work, you can start rotating backups over several copies. Also, you can improve the process depending on the kind of data you want to backup. If it's mainly source files, you should probably start using a DVCS such as Git, and backup its repository. If you have mainly mailboxes you could convert them to Maildir format, and so on.
  • I wanted to use rsync since it seems less of an arcane method than dump and restore which are even less documented online, but it still is complex enough to require serious research on setting the parameters. However this answer was informative in some of the less discussed aspects of rsync backups. – lvl1 May 5 '15 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.