Skip to content

Commit

Permalink
Merge pull request #12 from Schlepptop/master
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez authored Jul 14, 2020
2 parents a776444 + 7cc4413 commit 7016cb4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-null}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-null}
AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-null}
S3_STORAGE_CLASS=${S3_STORAGE_CLASS:-STANDARD}

BACKUP_NAME=${BACKUP_NAME:-backup}
BUCKET_NAME=${BUCKET_NAME:-null}
Expand All @@ -32,10 +33,10 @@ fi
TARGET="backup/"
if [[ -n "$ENCRYPTION_KEY" ]]; then
# shellcheck disable=SC2086
/bin/tar -czf - "$TARGET" | gpg --batch --no-tty -q -c --passphrase "$ENCRYPTION_KEY" | aws $ENDPOINT_URL_PARAMETER s3 cp - "s3://$BUCKET_NAME/$BACKUP_NAME-$TIMESTAMP.tgz.gpg"
/bin/tar -czf - "$TARGET" | gpg --batch --no-tty -q -c --passphrase "$ENCRYPTION_KEY" | aws $ENDPOINT_URL_PARAMETER s3 cp - "s3://$BUCKET_NAME/$BACKUP_NAME-$TIMESTAMP.tgz.gpg" --storage-class $S3_STORAGE_CLASS
else
# shellcheck disable=SC2086
/bin/tar -czf - "$TARGET" | aws $ENDPOINT_URL_PARAMETER s3 cp - "s3://$BUCKET_NAME/$BACKUP_NAME-$TIMESTAMP.tgz"
/bin/tar -czf - "$TARGET" | aws $ENDPOINT_URL_PARAMETER s3 cp - "s3://$BUCKET_NAME/$BACKUP_NAME-$TIMESTAMP.tgz" --storage-class $S3_STORAGE_CLASS
fi

# shellcheck disable=SC2181
Expand Down

0 comments on commit 7016cb4

Please sign in to comment.