Skip to content

Instantly share code, notes, and snippets.

@stevekm
Last active September 16, 2015 14:46
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 stevekm/0477d0073998d882910a to your computer and use it in GitHub Desktop.
Save stevekm/0477d0073998d882910a to your computer and use it in GitHub Desktop.
Use rsync to backup all your data from a remote server
#!/bin/bash
rsync -avzheR --progress --max-size=500K -e "ssh -p 22" user@server.com:/home/user/ /home/user/ServerBackups/
# "ssh -p 22" = connect via ssh, port 22
# -a, --archive archive mode; same as -rlptgoD (no -H)
# -v, --verbose increase verbosity
# -z, --compress compress file data during the transfer
# -h, --human-readable output numbers in a human-readable format
# -e, --rsh=COMMAND specify the remote shell to use
# -R, --relative use relative path names
# rsync /source/ /destination/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment