Skip to content

Instantly share code, notes, and snippets.

@khoatran
Created September 29, 2017 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khoatran/0060dd186bf1d73f566735daeb3db881 to your computer and use it in GitHub Desktop.
Save khoatran/0060dd186bf1d73f566735daeb3db881 to your computer and use it in GitHub Desktop.
Rsync with options
#sync allows deleting files in target folder if the files in the source folder are deleted
rsync -rtvu --delete source_folder/ destination_folder/
#Compressing the files while transferring them
rsync -rtvz source_folder/ destination_folder/
#Transferring files between two remote systems
rsync -rtvz source_folder/ user@domain:/path/to/destination_folder/
rsync -rtvz source_folder/ user@xxx.xxx.xxx.xxx:/path/to/destination_folder/
rsync -rtvz source_folder/ server_name:/path/to/destination_folder/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment