Why isn't cron running my script?

Posted by Jingqiang Zhang on Ask Ubuntu See other posts from Ask Ubuntu or by Jingqiang Zhang
Published on 2012-09-05T01:57:39Z Indexed on 2012/09/05 21:50 UTC
Read the original article Hit count: 314

Filed under:

Now I want to use Backup and Whenever gem to automatic backup my database. When I connect the server by ssh as an added user to run backup perform -t my_backup,it works well.But the cron file:

0 22 * * * /bin/bash -l -c 'backup perform -t my_backup'

can't run at 22:00. When I use cat /etc/crontab check the cron's config file,it is:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

The /bin/bash and /bin/sh are different.What's the reason?How to do?

© Ask Ubuntu or respective owner

Related posts about cron