我正在尝试通过 cron 运行 casper.js 脚本。当我手动运行脚本时一切正常,但是当我通过 cron 运行它时,出现以下错误:
Traceback (most recent call last):
File "/usr/local/bin/casperjs", line 46, in <module>
status = subprocess.call(CASPER_COMMAND)
File "/usr/lib/python2.6/subprocess.py", line 480, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
我的 crontab 条目是:
30 9 * * * /usr/local/bin/casperjs lib/fsaupload.js arg1 arg2 arg3
我也试过
30 9 * * * python /usr/local/bin/casperjs lib/fsaupload.js arg1 arg2 arg3
这给了我同样的结果。有任何想法吗?我猜这可能是一个path
问题,但不知道从哪里开始!