Reputation: 9
mysqldump -u $dbUsername --password=$dbPassword --databases $db | gzip > ${dbBackup}/${db}-${date}.sql.gz
if [ echo $? -ne 0 ]; then
mail -s "Backup mysql cron job $0 failed" $MAIL_TO <<EOF
EOF
Error after executing the script - Unexpected end of line
Upvotes: 0
Views: 114
Reputation: 17258
The fi terminating the if statement was missing:
mysqldump -u $dbUsername --password=$dbPassword --databases $db | gzip > ${dbBackup}/${db}-${date}.sql.gz
if [ echo $? -ne 0 ]; then
mail -s "Backup mysql cron job $0 failed" $MAIL_TO <<EOF
EOF
fi
^^^
Upvotes: 1