Skip to content
This repository was archived by the owner on Apr 27, 2024. It is now read-only.

Commit d4a5e90

Browse files
author
benjamin-maynard
committed
Correct mistakenly updated variables for TARGET_DATABASE_NAME
1 parent d731b0d commit d4a5e90

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

resources/perform-backup.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@
55
has_failed=false
66

77

8-
9-
108
# Perform the database backup. Put the output to a variable. If successful upload the backup to S3, if unsuccessful print an entry to the console and the log, and set has_failed to true.
11-
if sqloutput=$(mysqldump -u $TARGET_DATABASE_USER -h $TARGET_DATABASE_HOST -p$TARGET_DATABASE_PASSWORD -P $TARGET_DATABASE_PORT $TARGET_DATABASE_NAMES 2>&1 > /tmp/$AWS_BUCCKET_BACKUP_NAME)
9+
if sqloutput=$(mysqldump -u $TARGET_DATABASE_USER -h $TARGET_DATABASE_HOST -p$TARGET_DATABASE_PASSWORD -P $TARGET_DATABASE_PORT $TARGET_DATABASE_NAME 2>&1 > /tmp/$AWS_BUCCKET_BACKUP_NAME)
1210
then
1311

14-
echo -e "Database backup successfully completed for $TARGET_DATABASE_NAMES at $(date +'%d-%m-%Y %H:%M:%S')."
12+
echo -e "Database backup successfully completed for $TARGET_DATABASE_NAME at $(date +'%d-%m-%Y %H:%M:%S')."
1513

1614
# Perform the upload to S3. Put the output to a variable. If successful, print an entry to the console and the log. If unsuccessful, set has_failed to true and print an entry to the console and the log
1715
if awsoutput=$(aws s3 cp /tmp/$AWS_BUCCKET_BACKUP_NAME s3://$AWS_BUCKET_NAME$AWS_BUCKET_BACKUP_PATH$AWS_BUCCKET_BACKUP_NAME 2>&1)
1816
then
19-
echo -e "Database backup successfully uploaded for $TARGET_DATABASE_NAMES at $(date +'%d-%m-%Y %H:%M:%S')."
17+
echo -e "Database backup successfully uploaded for $TARGET_DATABASE_NAME at $(date +'%d-%m-%Y %H:%M:%S')."
2018
else
21-
echo -e "Database backup failed to upload for $TARGET_DATABASE_NAMES at $(date +'%d-%m-%Y %H:%M:%S'). Error: $awsoutput" | tee -a /tmp/aws-database-backup.log
19+
echo -e "Database backup failed to upload for $TARGET_DATABASE_NAME at $(date +'%d-%m-%Y %H:%M:%S'). Error: $awsoutput" | tee -a /tmp/aws-database-backup.log
2220
has_failed=true
2321
fi
2422

2523
else
26-
echo -e "Database backup FAILED for $TARGET_DATABASE_NAMES at $(date +'%d-%m-%Y %H:%M:%S'). Error: $sqloutput" | tee -a /tmp/aws-database-backup.log
24+
echo -e "Database backup FAILED for $TARGET_DATABASE_NAME at $(date +'%d-%m-%Y %H:%M:%S'). Error: $sqloutput" | tee -a /tmp/aws-database-backup.log
2725
has_failed=true
2826
fi
2927

0 commit comments

Comments
 (0)