Last active
July 15, 2018 07:43
-
-
Save KevinYang21/cce1e88979dbc70a9a271722469b8801 to your computer and use it in GitHub Desktop.
Template command to sync old devbox and new devbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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