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.

Cyberzinga
  • 11
  • 1

1 Answers1

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.

tlhIngan
  • 3,372
  • 5
  • 21
  • 33