Skip to content

Instantly share code, notes, and snippets.

@davidvanvickle
Created June 7, 2012 18:58
Show Gist options
  • Save davidvanvickle/2890812 to your computer and use it in GitHub Desktop.
Save davidvanvickle/2890812 to your computer and use it in GitHub Desktop.
rsync notes
# rsync notes
# TRY WITH TEST ACCOUNTS FIRST
# based on
# http://www.cyberciti.biz/tips/linux-use-rsync-transfer-mirror-files-directories.html
# -------
# Goal: download data (including folders) from a remote server
# download files
rsync -r -a -v -e "ssh -l remote-user" 1.2.3.4:/home/remote-user/ /Users/local-user/Desktop/backupfolder/
# download files destructively
rsync -r -a -v -e "ssh -l remote-user" --delete 1.2.3.4:/home/remote-user/ /Users/local-user/Desktop/backupfolder/
# -------
# Goal: upload data (including folders) to a remote server
# UPload files
rsync -r -a -v -e "ssh -l remote-user" /Users/local-user/Desktop/backupfolder/ 1.2.3.4:/home/remote-user/
# UPload files destructively
rsync -r -a -v -e "ssh -l remote-user" --delete /Users/local-user/Desktop/backupfolder/ 1.2.3.4:/home/remote-user/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment