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
执行脚本后出错 - 意外的行结束
答案 0 :(得分:1)
终止if语句的fi丢失了:
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
^^^