Skip to content

Instantly share code, notes, and snippets.

@skystar-p
Created May 24, 2018 09:41
Show Gist options
  • Save skystar-p/35c4873eb93ba563b98b5a17e3247e70 to your computer and use it in GitHub Desktop.
Save skystar-p/35c4873eb93ba563b98b5a17e3247e70 to your computer and use it in GitHub Desktop.
파이썬 스크립트를 바쿠스 GPU 서버에서 원격으로 돌리는 스크립트
#!/usr/bin/env bash
set -e
USERNAME=$USER
PWD=`pwd`
TARGETDIR=`basename $PWD`
DIR="/csehome/$USERNAME/.rpy/$TARGETDIR"
REMOTE="YOUR_HOST_NAME"
ssh $REMOTE -- rm -rf "$DIR"
ssh $REMOTE -- mkdir -p "$DIR"
rsync -avz "$PWD/" "$REMOTE:$DIR"
ssh -t $REMOTE -- "cd \"$DIR\" && /usr/bin/python3 $@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment