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.