Skip to content

Instantly share code, notes, and snippets.

@hanvari
Last active July 3, 2021 13:55
Show Gist options
  • Save hanvari/e80827e48c675372d9140099fba79607 to your computer and use it in GitHub Desktop.
Save hanvari/e80827e48c675372d9140099fba79607 to your computer and use it in GitHub Desktop.
rsync cheatsheet

RSync Commands CheatSheet

$ rsync --zaP src/ dst
$ rsync --zaP -e 'ssh -p <port-number>' src/ dst
$ rsync --anv src/ dst
$ rsync --delete
$ rsync --exclude=pattern
$ rsync --exclude=p --include=p
$ rsync -a --delete --backup --backup-dir=/path/ src dst
$ rsync --exclude=".*" #all hidden files and folders
$ rsync --explude=".*/" #only hidden folders

Ref: https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories Ref: https://www.tecmint.com/sync-files-using-rsync-with-non-standard-ssh-port/ Ref: https://askubuntu.com/a/482920

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment