Skip to content

Commit fb40974

Browse files
author
joseneto
committed
exit on error if dump fail
1 parent e9d858d commit fb40974

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

functions.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ make_backup () {
2626

2727
fi
2828

29+
# exit if last command have problems
30+
if [ "$?" != "0" ]; then
31+
echo "Error occurred in database dump process. Exiting now"
32+
exit 1
33+
fi
2934
# compress the file
3035
gzip -9 $FILENAME-$DATETIME.sql
3136
# Send to cloud storage

0 commit comments

Comments
 (0)