1

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?

Anthon
  • 79,293
MemphiZ
  • 147

1 Answers1

3

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>

Disclaimer

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:

/boot/
/lib/modules
/etc/modules
/etc/lilo.conf
/etc/fstab
/etc/mtab
/var/log
/etc/network/interfaces
/etc/hostname
/etc/hosts
  • 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 04:06