Last active
November 27, 2018 14:59
-
-
Save Jaid/4cf808e1a5cf63950f0c634aa60eb1eb to your computer and use it in GitHub Desktop.
Run a Bash script on a remote server via SSH and SCP
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
#!/usr/bin/bash | |
SCRIPT=/c/tmp/setup.bash | |
SSH_USER=jaid | |
SSH_HOST=example.com | |
scp $SCRIPT $SSH_USER@$SSH_HOST:~/local.bash | |
ssh $SSH_USER@$SSH_HOST "DEBIAN_FRONTEND=noninteractive PS4='[:\$LINENO] ' bash -e -x ~/local.bash" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment