我已经设置了一个 cronjob,如下所示,当我从 shell 运行它时,脚本运行得非常好,但是当通过 cronjob 运行时,我遇到了以下错误。
知道 cronjob 是做什么的吗?这里有什么环境问题吗?任何调试指针?
28 21,0 * * * /usr/bin/python /local/mnt/workspace/user/Automation/script.py project branch
错误
Traceback (most recent call last):
File "/local/mnt/workspace/user/Automation/script.py", line 74, in <module>
output = phCmdoutput(phCmd)
File "/local/mnt/workspace/user/Automation/script.py", line 28, in phCmdoutput
phPipe = Popen(phCmd, stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory