Skip to content

Instantly share code, notes, and snippets.

@nicholashoule
Last active October 20, 2025 06:24
Show Gist options
  • Select an option

  • Save nicholashoule/09d58014fc0280a3ff9afaf501431a64 to your computer and use it in GitHub Desktop.

Select an option

Save nicholashoule/09d58014fc0280a3ff9afaf501431a64 to your computer and use it in GitHub Desktop.
Rsync and SSH

Rsync and SSH

rsync --help

Options
 -v, --verbose               increase verbosity
 -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
 -r, --recursive             recurse into directories
 -n, --dry-run               perform a trial run with no changes made
 -e, --rsh=COMMAND           specify the remote shell to use
...
 -c, --checksum              skip based on checksum, not mod-time & size
 -u, --update                skip files that are newer on the receiver
 -z, --compress              compress file data during the transfer
 ...
 
PULL FROM REMOTE HOST (DOWNLOAD):
rsync -ravz -e ssh [email protected]:/opt/ /home/user/directory/
rsync -avz -e "ssh -A -i /home/user/.ssh/id_rsa" [email protected]:/opt/data /home/user/projects/data
PUSH TO REMOTE HOST (UPLOAD):
rsync -u -ravz -e ssh /home/user/directory/ [email protected]:/opt/
rsync -avz -e "ssh -p 10010" /home/user/directory/ [email protected]:/opt/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment