Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been reading about using rsync and rdiff-backup to make incremental backups of my entire Linux system. I am planning to practise that by setting up a Linux system, making some changes to it, erasing everything and restoring the system (all with the convenience of doing it in a virtual machine). But I want to clarify a few things before taking the plunge:

  1. How do I get fine control about what gets included in and excluded from the backup? i.e. by default would everything (including invisible "." files, trash, etc.) be backed up? If so, how can I exclude some of them?
  2. The rdiff-backup tutorial tells you how to retrieve a file from an arbitrary time in the past (as long as you still have the backup). What if I want to restore the complete system on a new computer? How do I do that?
  3. Suppose I make backups of my system on machine A. A few years later I buy a new computer B, and want to restore my system from the backup of machine A. Since the hardware might be totally different, will my new system work when I try to start it up after the restore? How can I ensure a smooth restore onto a new machine?

Thanks for your answers.

share|improve this question
I hope you don't mind me splitting off your last question into "What I can I do to make the transition to some new computer hardware safe and smooth?" – David Cary Feb 27 '11 at 3:00
That's fine, in fact thanks for doing that! – hpy Feb 27 '11 at 11:46
up vote 4 down vote accepted

(If you have three questions, it's better to ask three separate questions. But since the answers are short I'll answer them all.)

  1. Both rsync and rdiff-backup have fairly powerful file selection mechanisms, based on inclusion and exclusion rules. I wrote an rsync filter tutorial. Rdiff-backup's filters are based on the same principles but the details are different, see “file selection” section in the manual.

  2. Restore the whole backup (i.e. the root directory of the backup tree) as of now: rdiff-backup -r now /path/to/backup /where/to/restore.

  3. There's nothing in the storage format that depends on your hardware. You can save and restore on different machines, it doesn't matter.

share|improve this answer
2. Yes but if I have an empty computer w/ no OS that I want to restore to, how do I do that? 3. Does that mean all my system files are not hardware specific, and that after the restore my system will just boot up and start working as if nothing happened? And OK, if I ask something like this again in the future I will split up the question. :) Sorry about the wordiness... – hpy Feb 26 '11 at 0:03
@penyuan: You need to start from some OS. If you have an empty computer, you'll need to boot from a CD/USB/…, and recreate the partitions and filesystems you want. Then you can use file-level backup tools such as rsync or rdiff-backup to restore your files. – Gilles Feb 26 '11 at 0:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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