pass appid to backup script

This commit is contained in:
Girish Ramakrishnan
2016-04-10 21:41:53 -07:00
parent ba663faa64
commit b2668579d6
2 changed files with 14 additions and 10 deletions
+10 -9
View File
@@ -12,21 +12,22 @@ if [[ $# == 1 && "$1" == "--check" ]]; then
exit 0
fi
if [ $# -lt 7 ]; then
echo "Usage: backupapp.sh <s3 config url> <s3 data url> <access key id> <access key> <session token> <region> <password>"
if [ $# -lt 8 ]; then
echo "Usage: backupapp.sh <appid> <s3 config url> <s3 data url> <access key id> <access key> <session token> <region> <password>"
exit 1
fi
readonly DATA_DIR="${HOME}/data"
# env vars used by the awscli
s3_config_url="$1"
s3_data_url="$2"
export AWS_ACCESS_KEY_ID="$3"
export AWS_SECRET_ACCESS_KEY="$4"
export AWS_SESSION_TOKEN="$5"
export AWS_DEFAULT_REGION="$6"
password="$7"
readonly app_id="$1"
readonly s3_config_url="$2"
readonly s3_data_url="$3"
export AWS_ACCESS_KEY_ID="$4"
export AWS_SECRET_ACCESS_KEY="$5"
export AWS_SESSION_TOKEN="$6"
export AWS_DEFAULT_REGION="$7"
readonly password="$8"
readonly now=$(date "+%Y-%m-%dT%H:%M:%S")
readonly app_data_dir="${DATA_DIR}/${app_id}"