
Debian Jessie Raspberry Piでcronを使用してPythonスクリプトを実行しようとしましたが、成功しませんでした。
スクリプトは手動で実行できますが、cronは使用できません。
表示内容は次のとおりですcrontab -l
。
*/2 * * * * /usr/bin/python2 home/pi/Documents/get_temperature.py
cronコンテキストのパスに問題があるようですが、問題が見つかりませんでした。
答え1
指定したファイルパスは絶対パスのように見えますが、get_temperature.py
()で始まりません。/
/home
home/pi/Documents/get_temperature.py
所有者のホームディレクトリにない場合は、パスをcrontab
変更する必要があります。
*/2 * * * * /usr/bin/python2 /home/pi/Documents/get_temperature.py