Skip to content

Instantly share code, notes, and snippets.

@erik-pantheon
Created January 28, 2016 15:43
Show Gist options
  • Save erik-pantheon/37c35d4cebad6a0eaf08 to your computer and use it in GitHub Desktop.
Save erik-pantheon/37c35d4cebad6a0eaf08 to your computer and use it in GitHub Desktop.
rsync on pantheon
ENV='ENV'
SITE='SITEID'
read -sp "Your Pantheon Password: " PASSWORD
if [[ -z "$PASSWORD" ]]; then
echo "Woops, need password"
exit
fi
while [ 1 ]
do
sshpass -p "$PASSWORD" rsync --partial -rlvz --size-only --ipv4 --progress -e 'ssh -p 2222' $ENV.$SITE@appserver.$ENV.$SITE.drush.in:files/* ./files/
if [ "$?" = "0" ] ; then
echo "rsync completed normally"
exit
else
echo "Rsync failure. Backing off and retrying..."
sleep 180
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment