Last active
April 11, 2021 13:38
-
-
Save g10guang/5733473fd6742e23e7c087c3b1df06bf to your computer and use it in GitHub Desktop.
sync local code to remote server
This file contains 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
set -ex | |
prepath=`dirname $PWD` | |
# make sure both mac & devbox satisfy, $GOPATH=$HOME/go | |
myhome="${HOME}/" | |
prepath=${prepath:${#myhome}} | |
# set your own devbox username, mine is liuxiguang | |
devboxusername="liuxiguang" | |
sshpass -p ${devboxusername} rsync -avr --delete --exclude=test.go --exclude=.idea --exclude=.vscode --exclude=output ${PWD} dev:/home/${devboxusername}/$prepath | |
echo $(date -u +"%Y-%m-%d %H:%M:%S%Z") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment