【发布时间】:2013-10-04 06:59:45
【问题描述】:
我在 IBM AIX 服务器上有一个 cron 作业,或多或少像这样安排:
0 6 * * * (date >> ~/executions.log;. ~/.profile; cd /usr/path/to/the/script; /usr/path/to/the/script/ThisIsTheScript.sh ) > /dev/null 2>&1
当我安排这样的测试运行时:
0,37 6 * * * (date >> ~/executions.log;. ~/.profile; cd /usr/path/to/the/script; /usr/path/to/the/script/ThisIsTheScript.sh ) > /dev/null 2>&1
...作业只会运行到将最后执行日期附加到~/executions.log 的部分。由于这个脚本调用了一个非常庞大的应用程序——我们称之为gargantuanprogram——一旦工作启动它应该出现在ps ax | grep gargantuanprogram。但它没有,它甚至没有运行ThisIsTheScript.sh,因为所述脚本在启动时会发送电子邮件通知,而在我的邮箱中我只是收到 nada。
如您所见,是的,我正在加载我的~/profile,我多次检查该脚本是否具有执行权限,并且我绝对确定该行编写正确。 crontab 也以换行符结束。那为什么作业没有执行呢?
【问题讨论】: