This question already has an answer here:

I have Mint Linux installed on my Computer at home, on my Laptop and on a bootable USB3 stick. I would like these three systems to be completely identical when I get home. For example:

I work on my Desktop at home. Before I leave to work I start some kind of script/application which pushes all changes to the USB stick and Laptop. When I get home from work (used the laptop all day) I would like to start the script/application but this time it pushes all changes from the Laptop to the Desktop and USB stick. And of course if I used the USB stick at a friends place for example I would like to sync everything from it to the two computers.

I actually I don't need a sync, I need more of a push because I won't be working on more than one of these simultaneously.

Is this possible?

marked as duplicate by jasonwryan, slm, Anthon, Zelda, Hauke Laging Feb 12 '14 at 9:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Are you wanting to backup everything under / or just /home? – Nathan S. Watson-Haigh Feb 12 '14 at 3:19
  • I want to backup everything. So / would be great as I have everything on one partition. – MemphiZ Feb 12 '14 at 4:05
  • Does the duplicate questions have an appropriate answer? I think the point about a 1:1 copy of everything is a good one. After all, you'll have different hardware etc. – Nathan S. Watson-Haigh Feb 12 '14 at 22:31

I think rsync could do the job for you? You'd just need to get the source and destination the right way round depending on if you're "pushing" or "pulling".

You could start with an rsync something like this (untested):

rsync --archive --acls --compress --delete --hard-links \
  --exclude '/run/*' \
  --exclude '/dev/*' \
  --exclude '/media/*' \
  --exclude '/mnt/*' \
  --exclude '/proc/*' \
  --exclude '/sys/*' \
  --exclude '/tmp/*' \
  --exclude '/var/run/*' \
  --exclude '/var/lock/*' \
  --exclude '/lib/modules/*/volatile/.mounted' \
  --exclude '/var/cache/apt/archives/*' \
  --exclude '/var/tmp/*' \
  / <destination>


Bearing in mind that a full 1:1 copy is probably not what you actually want due to differing hardware on the systems. For instance you might not want the same hostname, network configuration, bootloader, mount points etc. None of these have been addressed in the above example.

To address some (all?) of these, you might consider adding the following excludes:

  • Could you give an example of the switches I need to use to not mess up anything because of permissions for example? – MemphiZ Feb 12 '14 at 4:06

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