====== Ubuntu - Backups - Synchronize files in a directory between 2 hosts ====== Synchronize files in a directory between 2 hosts using the program rsync. rsync -av --delete --rsh="ssh -c arcfour -l root" host1.domain.lan:/disk01/ /disk01/ * **-a**: The files are transferred in "archive" mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer. * **-v**: Increase verbosity. * **--delete**: The destination is always made to look like the source even if files need to be deleted in the destination. The source's data is never touched. * This uses ssh as the remote-shell program as the transport. * **-c** arcfour: Turns on the lowest grade encryption to speed up the transfer. * **-l** root: Specifies the user to log in as on the remote machine. * The source is always named first * host1's /disk01 (source) is the remote host * The destination is always named second. * /disk01 (destination) is a local directory. * Trailing / on the source means copy the contents of this directory to the destination. Without the trailing / the source gets the directory name copied with all it's files in it.