Sync folders between linux servers using rsync
January 12th, 2009
I have my netbook, and I have a server. Now I want to sync files between these machines in order to keep a backup of all the documents of my netbook on the server. I found a page which explains how to sync between two servers. With a little tweak I created the command which I needed in order to sync the two folders.
$ rsync -avrR --links --rsh=/usr/bin/ssh ~/Documents/ home.basvandijk.eu:
In this command Documents/ is the documents folder in my home dir, home.basvandijk.eu is the server containing a Documents folder as well which is used to sync to.
- -a enables archive mode
- -v enables verbose mode
- -r means recursive
- -R means use relative paths
- –links means copy symlinks as symlinks
- -rsh specifies which remote shell to use