File tree Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Expand file tree Collapse file tree 1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,40 @@ for dbName in ${DB_NAMES}; do
88 echo " mysql-backup-restore: Backing up ${dbName} "
99
1010 start=$( date +%s)
11- mysqldump -h ${MYSQL_HOST} -u ${MYSQL_USER} -p" ${MYSQL_PASSWORD} " ${MYSQL_DUMP_ARGS} ${dbName} > /tmp/${dbName} .sql || STATUS=$?
11+ mysqldump -h ${MYSQL_HOST} -u ${MYSQL_USER} -p" ${MYSQL_PASSWORD} " ${MYSQL_DUMP_ARGS} ${dbName} > /tmp/${dbName} .sql
12+ STATUS=$?
1213 end=$( date +%s)
1314
1415 if [ $STATUS -ne 0 ]; then
16+ echo " *** START DEBUGGING FOR NON-ZERO STATUS ***"
17+
18+ # Display update
19+ uptime
20+ echo
21+
22+ # display free drive space (in megabytes)
23+ df -m
24+ echo
25+
26+ # display free memory in megabytes
27+ free -m
28+ echo
29+
30+ # display swap information
31+ swapon
32+ echo
33+
34+ echo " *** END DEBUGGING FOR NON-ZERO STATUS ***"
35+
1536 echo " mysql-backup-restore: FATAL: Backup of ${dbName} returned non-zero status ($STATUS ) in $( expr ${end} - ${start} ) seconds."
1637 exit $STATUS
1738 else
1839 echo " mysql-backup-restore: Backup of ${dbName} completed in $( expr ${end} - ${start} ) seconds, ($( stat -c %s /tmp/${dbName} .sql) bytes)."
1940 fi
2041
2142 start=$( date +%s)
22- gzip -f /tmp/${dbName} .sql || STATUS=$?
43+ gzip -f /tmp/${dbName} .sql
44+ STATUS=$?
2345 end=$( date +%s)
2446 if [ $STATUS -ne 0 ]; then
2547 echo " mysql-backup-restore: FATAL: Compressing backup of ${dbName} returned non-zero status ($STATUS ) in $( expr ${end} - ${start} ) seconds."
@@ -29,7 +51,8 @@ for dbName in ${DB_NAMES}; do
2951 fi
3052
3153 start=$( date +%s)
32- s3cmd put /tmp/${dbName} .sql.gz ${S3_BUCKET} || STATUS=$?
54+ s3cmd put /tmp/${dbName} .sql.gz ${S3_BUCKET}
55+ STATUS=$?
3356 end=$( date +%s)
3457 if [ $STATUS -ne 0 ]; then
3558 echo " mysql-backup-restore: FATAL: Copy backup to ${S3_BUCKET} of ${dbName} returned non-zero status ($STATUS ) in $( expr ${end} - ${start} ) seconds."
You can’t perform that action at this time.
0 commit comments