Skip to content

Instantly share code, notes, and snippets.

@aginanjar
Created December 18, 2018 03:30
Show Gist options
  • Save aginanjar/d48ce26021a9d1c7a7df058c638a2292 to your computer and use it in GitHub Desktop.
Save aginanjar/d48ce26021a9d1c7a7df058c638a2292 to your computer and use it in GitHub Desktop.
Example of rsync (file copying tool)

Server to Local

$ rsync -avz -e --progress "/usr/bin/ssh -i /Users/local/if-any.pem" user@your-remote-server:/home/server/path/your-file.txt /Users/local/path/

or without *.pem

rsync -avz --progress user@your-remote-server:/var/www/ /Users/local/file.extension

Local to Server

$ rsync -avz -e --progress "/usr/bin/ssh -i /Users/local/if-any.pem" /Users/local/path/your-file.txt user@your-remote-server:/home/server/path/

or without *.pem

rsync -avz --progress /Users/local/file.extension root@your-remote-server:/var/www/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment