Skip to content

Rename Variable name S3_BUCKET_PATH to AWS_BUCKET #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ heroku buildpacks:add https://github.com/svikramjeet/db-back-s3 --app <your_app>
heroku config:add AWS_ACCESS_KEY_ID=XXX --app <your_app>
heroku config:add AWS_SECRET_ACCESS_KEY=YYY --app <your_app>
heroku config:add AWS_DEFAULT_REGION=region --app <your_app> (region example eu-west-1)
heroku config:add S3_BUCKET_PATH=bucket_name --app <your_app>
heroku config:add AWS_BUCKET=bucket_name --app <your_app>

```

Expand Down
6 changes: 3 additions & 3 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ if [[ -z "$AWS_DEFAULT_REGION" ]]; then
echo "Missing AWS_DEFAULT_REGION variable"
exit 1
fi
if [[ -z "$S3_BUCKET_PATH" ]]; then
echo "Missing S3_BUCKET_PATH variable"
if [[ -z "$AWS_BUCKET" ]]; then
echo "Missing AWS_BUCKET variable"
exit 1
fi
if [[ -z "$DATABASE_URL" ]]; then
Expand All @@ -58,6 +58,6 @@ time pg_dump -b -F c --dbname=$DATABASE_URL | gzip > /tmp/"${DBNAME}_${FILENAME
EXPIRATION_DATE=$(date -d "$EXPIRATION days" +"%Y-%m-%dT%H:%M:%SZ")

printf "${Green}Move dump to AWS${EC}"
time /app/vendor/bin/aws s3 cp /tmp/"${DBNAME}_${FILENAME}".gz s3://$S3_BUCKET_PATH/$DBNAME/"${DBNAME}_${FILENAME}".gz --expires $EXPIRATION_DATE
time /app/vendor/bin/aws s3 cp /tmp/"${DBNAME}_${FILENAME}".gz s3://$AWS_BUCKET/$DBNAME/"${DBNAME}_${FILENAME}".gz --expires $EXPIRATION_DATE
# cleaning after all
rm -rf /tmp/"${DBNAME}_${FILENAME}".gz
2 changes: 1 addition & 1 deletion dns-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dig $1 any +noall +answer | gzip > /tmp/"${FNAME}_${FILENAME}".gz
EXPIRATION_DATE=$(date -d "$EXPIRATION days" +"%Y-%m-%dT%H:%M:%SZ")

printf "${Green}Move dns-backup to AWS${EC}"
time /app/vendor/bin/aws s3 cp /tmp/"${FNAME}_${FILENAME}".gz s3://$S3_BUCKET_PATH/$FNAME/"${FNAME}_${FILENAME}".gz --expires $EXPIRATION_DATE
time /app/vendor/bin/aws s3 cp /tmp/"${FNAME}_${FILENAME}".gz s3://$AWS_BUCKET/$FNAME/"${FNAME}_${FILENAME}".gz --expires $EXPIRATION_DATE

# cleaning after all
rm -rf /tmp/"${FNAME}_${FILENAME}".gz
2 changes: 1 addition & 1 deletion env-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ time printenv | gzip > /tmp/"${FNAME}_${FILENAME}".gz
EXPIRATION_DATE=$(date -d "$EXPIRATION days" +"%Y-%m-%dT%H:%M:%SZ")

printf "${Green}Move env-backup to AWS${EC}"
time /app/vendor/bin/aws s3 cp /tmp/"${FNAME}_${FILENAME}".gz s3://$S3_BUCKET_PATH/$FNAME/"${FNAME}_${FILENAME}".gz --expires $EXPIRATION_DATE
time /app/vendor/bin/aws s3 cp /tmp/"${FNAME}_${FILENAME}".gz s3://$AWS_BUCKET/$FNAME/"${FNAME}_${FILENAME}".gz --expires $EXPIRATION_DATE

# cleaning after all
rm -rf /tmp/"${FNAME}_${FILENAME}".gz