Last active
March 19, 2019 10:16
-
-
Save sahir/fbc7832a286eddd151f68b68b50e1879 to your computer and use it in GitHub Desktop.
Transferring files between remote server to S3
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
#!/bin/sh | |
if [ $1 == "help" ]; | |
then | |
echo "First argument: Path of file on Remote host. \nSecond argument: Path of directory on Local host.\nThird argument: OS type. | |
Forth argument: configure aws boolean values true/false.\nFifth argument: S3Uri." | |
else | |
scp -rv $6:$1 $2 | |
if [ $3 == "mac" ]; then | |
brew install awscli | |
else | |
apt-get install -y awscli | |
fi | |
if [ $4 ]; then | |
aws configure | |
fi | |
aws s3 cp $2 s3://$5 --recursive | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment