Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@danielpcox
Last active December 21, 2015 13:19
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 danielpcox/6311864 to your computer and use it in GitHub Desktop.
Save danielpcox/6311864 to your computer and use it in GitHub Desktop.
retrync ("retrying rsync") executes resumable rsync uploading/downloading via SSH with progress over and over until the transfer is complete. First stick your public SSH key in ~/.ssh/authorized_keys on the remote server. Original version came from http://blog.iangreenleaf.com/2009/03/rsync-and-retrying-until-we-get-it.html
#!/bin/bash
# Usage: retrync path/to/thing/locally user@host:/path/where/you/want/it/remotely
trap "echo Exited!; exit;" SIGINT SIGTERM
false
while [ $? -ne 0 ]
do
rsync --timeout=10 -P -h -e ssh $1 $2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment