我試圖通過cron運行casper.js腳本。一切工作正常,當我手動運行該腳本,但是當我通過cron運行它,我得到以下錯誤:從cron運行casper.js腳本
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
問題,但不知道該從哪裏出發!
嗯......還是什麼都沒有。我仍然得到同樣的錯誤。我甚至嘗試指定Python的完整路徑,但仍然沒有骰子。有任何想法嗎? – Pezholio
編輯,讓我知道:) – NiKo
這就是它 - 謝謝你! :) – Pezholio