Skip to content

Instantly share code, notes, and snippets.

@ntrepid8
Created November 29, 2017 15:09
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 ntrepid8/b26a7223bbb1d29d0b780602cf01ead2 to your computer and use it in GitHub Desktop.
Save ntrepid8/b26a7223bbb1d29d0b780602cf01ead2 to your computer and use it in GitHub Desktop.
Rsync via SSH

Rsync via SSH

Use rsync via ssh to transfer large files or groups of files. It even has a progess bar :)

Push file(s):

$ rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress --delete \
"$LOCAL_PATH" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH"

Pull file(s):

$ rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress --delete \
"$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH" "$LOCAL_PATH"

notes:

  • if you want to rsync the contents of a directory be sure to include the trailing slash /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment