Skip to content

Instantly share code, notes, and snippets.

@azulkipli
Last active February 13, 2019 11:30
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 azulkipli/df4ccab7a343438a0dcab49f18a2c58f to your computer and use it in GitHub Desktop.
Save azulkipli/df4ccab7a343438a0dcab49f18a2c58f to your computer and use it in GitHub Desktop.
alias script to backup & rsync remote folder
# alias backup
alias backup-appname='ssh -i ~/path_to/sshkey.pem user@ip_address "tar jcfv /fullpath_server_directory/filename-`date +%F.%H%M`.tar.bz2 /fullpath_server_directory/app_directory"'
# alias rsync
alias rsync-appname='rsync -a -e "ssh -i /local_fullpath_to/sshkey.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" -rz --progress --delete-after /local_fullpath_to/app_directory/ user@ip_address:/fullpath_server_directory/app_directory/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment