我的cron工作不起作用

时间:2017-01-28 03:56:09

标签: shell cron crontab

我创建了一个shell脚本,用于创建mongo的备份并推送bitbucket帐户。

当我手动运行shell脚本时,它工作正常。但是cronjob没有运行

Crontab -

00 01,13 * * * /home/ubuntu/work_area/mongodumps/mongo_backup.sh

Shell脚本

DIR=`date +%m-%d-%y`
#DEST=/home/ubuntu/Desktop/nitin/mongodumps/$DIR
DEST="/home/ubuntu/work_area/mongodumps"
echo $DEST
#mkdir -p $DEST
mongodump --host localhost --port 17117 -d "db_c2a" -o "$DEST"


git add .
#git commit -m `date +%m%d%y+ autocommit`
git commit -m "Auto commit"+$DIR
git push -u origin master

我检查了cron日志,它在这里

Jan 28 01:00:01 ip-172-31-26-102 CRON[5506]: (root) CMD (/home/ubuntu/work_area/mongodumps/mongo_backup.sh)
Jan 28 01:00:01 ip-172-31-26-102 CRON[5505]: (CRON) info (No MTA installed, discarding output)
Jan 28 01:17:01 ip-172-31-26-102 CRON[5523]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

0 个答案:

没有答案