Skip to content

Instantly share code, notes, and snippets.

@phx
Created June 19, 2013 20:04
Show Gist options
  • Save phx/5817554 to your computer and use it in GitHub Desktop.
Save phx/5817554 to your computer and use it in GitHub Desktop.
recursive rsync over ssh on non-standard port, with update, compression, progress bars, and more.
#!/bin/bash
# -a -- recursive, preserving date/time/ownership (`man rsync`)
# -u -- update (only replace/add files that are newer or non-existent on the target)
# -v -- verbose output
# -z -- compression
# --progress -- show progress bar with current transfer status
# -e -- execute command
rsync -auvz --progress [local source directory] -e "ssh -p [port]" user@ip:/path/to/target/directory/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment