0

I use two linux machines, home pc and server.

Lets say i want to modify some config files on both systems. How can i synchronize them to make these modifications ony once?

Is there option to add new machine to this hypotetical synchronized network and apply all previous changes to new machine?

adam767667
  • 361
  • 2
  • 5

1 Answers1

1

You can write a bash script that uses rsync to sync/copy your config files or folders and run it after you change something.

example:

$ rsync -az --progress --size-only /home/test/* server.example.com:/home/test/destination/

explained:

  • -a archive, preserves all attributes like recursive ownership, timestamps, etc
  • -z compress, saves bandwidth but is harder on your CPU so use it for slow/expensive connections only
  • --progress shows you the progress of all the files that are being synced
  • --size-only compare files based on their size instead of hashes (less CPU, so faster)
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175