I'm trying without success to execute a Python script using cron on a Debian Jessie Raspberry Pi.

I can execute the script manually, but it fails to execute with cron.

Here's what crontab -l shows:

*/2 * * * *  /usr/bin/python2 home/pi/Documents/get_temperature.py

I guess there's something wrong with paths in the cron context but I cannot manage to find what.

closed as off-topic by dhag, cuonglm, chaos, jimmij, Archemar Nov 27 '15 at 9:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – dhag, cuonglm, chaos, jimmij, Archemar
If this question can be reworded to fit the rules in the help center, please edit the question.


The path to the get_temperature.py file you have given seems like an absolute path but has not started with a / (/home).

Unless you have home/pi/Documents/get_temperature.py in the home directory of the crontab owner, you need to correct the path:

*/2 * * * *  /usr/bin/python2 /home/pi/Documents/get_temperature.py
  • Thanks , it's working now. I have to buy some glasses I guess. 2 hours on that for a single / ! :-) – SadE Nov 26 '15 at 21:17
  • 1
    @SadE Please select it as accepted by clicking the tick mark on the left of my answer so that this this issue can be marked as solved.. – heemayl Nov 26 '15 at 21:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.