James Pannell
James Pannell

Reputation: 1

Issues with running a Python program with Cron

I am trying to run a Python script called probemon.py in cron (crontab -e) and cannot get it to work. The path to the file is /home/pi/probemon.py and this must be run with the sudo command usually (i.e. sudo python probemon.py). I have tried many methods, including:

52 23   *   *   *    sudo python /home/pi/probemon/probemon.py

and yet nothing works. Any ideas about how to do this?

Upvotes: 0

Views: 42

Answers (1)

Thomas
Thomas

Reputation: 76

Try adding the command to the sudo-users crontab instead of trying to run it with a sudo from a normal users crontab. I think what happends is that "sudo ..." will ask for the sudo-password, and wait in this stage forever, since noone is providing one.

Upvotes: 1

Related Questions