1

I am trying to run a python script at the startup of pi. Python file name is test.py. I am using raspberrypi-3 .

The command I have used :-

pi@raspberrypi:~$ sudo crontab -e

I have added the line within it :-

@reboot python /home/pi/Desktop/test.py & 

/home/pi/Desktop is the path of the python file.

I am rebooting the system using sudo reboot but script is not working automatically, where it is working manually.

2
  • Have you checked all the related posts? People will get annoyed if this has already been answered. If you have checked related posts you will need to edit your post and include the script and explain what part doesn't work.
    – joan
    Commented Jun 13, 2016 at 7:57
  • See also: raspberrypi.stackexchange.com/q/40493/5538
    – goldilocks
    Commented Jun 13, 2016 at 11:11

1 Answer 1

0

cron is best used to run things on a timed schedule, it sometimes doesn't behave as expected at boot time. To run things at boot time under Raspbian Jessie, your best bet is to use systemd by following this tutorial.

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