任何人都可以提供见解,为什么我的cron作业没有运行? 我尝试过简单的工作,比如date/时间工作,而且工作。
下面是我试图运行的一个例子:
# Begin Whenever generated tasks for: taxscribe 0 0,6,12,18 * * * /bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:submitted --silent' 0 * * * * /bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:extensions --silent' 0 * * * * /bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:accounts --silent' # End Whenever generated tasks for: taxscribe
谢谢你的帮助。
当crond试图执行这个工作时,也许rake不在PATH中? (尝试把耙子二进制的完整path)
确保crond正在运行
pgrep crond
检查crond是否正在运行,并检查是否已设置为使用系统启动
chkconfig crond --list
如果不是那么做
chkconfig crond on
有启动启动。
同时检查你的日志。 确保脚本中没有错误,阻止执行。
/var/log/cron
如果您正在运行的作业产生任何输出,那么cron会将其发送到正在运行作业的帐户。
您可以将作业的输出捕获到日志文件,例如
/bin/bash -l -c 'cd /home/deploy/taxscribe/releases/20110311205859 && RAILS_ENV=production rake informer:sync:submitted --silent &>/path/to/file.log'
看看有什么话要说