Skip to content

Instantly share code, notes, and snippets.

@KevinYang21
Last active July 15, 2018 07:43
Show Gist options
  • Save KevinYang21/cce1e88979dbc70a9a271722469b8801 to your computer and use it in GitHub Desktop.
Save KevinYang21/cce1e88979dbc70a9a271722469b8801 to your computer and use it in GitHub Desktop.
Template command to sync old devbox and new devbox
# To use the template, replace <instance_id> with the real devbox instance ids and run them on your local machine.
USERNAME=`whoami` # your SSH username
NEW_DEVBOX=<instance_id>.inst.aws.us-east-1.prod.musta.ch # hostname of the new devbox
OLD_DEVBOX=<instance_id>.inst.aws.us-east-1.prod.musta.ch # hostname of the old devbox
ssh -A $NEW_DEVBOX "sudo SSH_AUTH_SOCK="\$"SSH_AUTH_SOCK rsync -avzhe 'ssh -o StrictHostKeyChecking=no' —rsync-path='sudo rsync' $USERNAME@$OLD_DEVBOX:/home/$USERNAME/ /home/$USERNAME/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment