Skip to content

Part 3. Run the Script from Boot

Rachel edited this page Aug 24, 2016 · 2 revisions

Running a script from boot on the Pi is pretty straightforward. We're going to use a service called crontab:

sudo crontab -e

Pick your favorite text editor (I like nano) and at the bottom of the file (under all of the comments), add @reboot nohup sudo /usr/bin/python /home/pi/presence.py &. If you named your script something else or put it in a different directory, replace /home/pi/presence.py with the correct path. The path in my example is just the main Pi directory.

Save the file! You need to reboot for it to take effect, but we are going to add another task to our crontab in this next step.

<< Part 3: Making it Permanent - Part 3: Reboot on Network Loss >>