意外的结束

时间:2013-09-27 06:57:03

标签: shell

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

执行脚本后出错 - 意外的行结束

1 个答案:

答案 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
^^^