Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blueprintmrk/5732ed750aa42d9bcd732349319fa275 to your computer and use it in GitHub Desktop.
Save blueprintmrk/5732ed750aa42d9bcd732349319fa275 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