Skip to content

Instantly share code, notes, and snippets.

@morgangiraud
Created February 8, 2017 09:33
Show Gist options
  • Save morgangiraud/44c666698696d74b89f0f8552d0ed0fe to your computer and use it in GitHub Desktop.
Save morgangiraud/44c666698696d74b89f0f8552d0ed0fe to your computer and use it in GitHub Desktop.
.bashrc functions to synchronize the current folder to/from the server using rsync
synctoserver() {
rsync -Pav -e 'ssh -i mykey.pem' "$PWD" username@myserver.com:rsync/.
}
syncfromserver() {
rsync -Pav -e 'ssh -i mykey.pem' username@myserver.com:rsync/${PWD##*/}/. .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment