Skip to content

Instantly share code, notes, and snippets.

@jmakeig
Last active September 15, 2016 06:16
Show Gist options
  • Save jmakeig/593a4b34c04c91f46621ae50ca048345 to your computer and use it in GitHub Desktop.
Save jmakeig/593a4b34c04c91f46621ae50ca048345 to your computer and use it in GitHub Desktop.
Backup and restore with rsync
rsync -e 'ssh' -avlt --delete \
--exclude 'Microsoft User Data' \
--exclude '.parallels-vm-directory' \
--exclude 'Personal' \
--exclude '.DS_Store' \
--exclude '.git/' \
--exclude 'Virtual Machines.localized' \
--exclude 'WebEx' \
--exclude 'Web Receipts' \
--exclude 'Workspaces' \
$* \
/Users/jmakeig/Documents ssh.example.com:"$TARGET"
# <http://explainshell.com/explain?cmd=rsync+-e+%27ssh%27+-avlt+ssh.example.com%3A%2Fhome%2Fjmakeig%2FBACKUP%2FACTIVE%2FDocuments+.>
# -n for a trial run
# -t preserves file timestamps
rsync -e 'ssh' -avlt ssh.example.com:/home/jmakeig/BACKUP/ACTIVE/Documents .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment