我cron
在 IBM AIX 服务器上安排了一份工作,或多或少是这样安排的:
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
换行符终止。那么为什么作业没有执行呢?