Created
June 18, 2017 21:47
-
-
Save tobocop2/bfb50bd7a5cb45f98f1fb1442bf77397 to your computer and use it in GitHub Desktop.
server_cp
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
# works best if you configure passwordless ssh by copying your ssh-key to the authorized_keys file on the remote machine | |
function server_cp() | |
{ | |
scp $1 user@host | |
web_home=/path/to/web/home/ | |
filename=`basename $1` | |
ssh -t user@host "chmod 777 $filename; sudo cp -f $filename $web_home" | |
printf "File can be found at:\nhttp://some.url/$filename\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment