Skip to content

tomschelles/runonbootpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

runonbootpi

Run scripts on startup Raspberry PI

  1. Create a bash script
sudo nano start.sh

Example:

#!/bin/sh
sleep 10
cd /
cd home/pi/
sudo python program.py &
cd /

sleep 10 is needed to load system respos first

  1. Change rights to 775
sudo chmod 775 start.sh
  1. Make a crontab
sudo crontab -e
  1. Make a log file to catch all the errors
mkdir logs
chmod 775 logs
  1. Add the following line to the crontab
@reboot sudo sh /home/pi/start.sh >/home/pi/logs/cronlog 2>&1
  1. Now reboot
sudo reboot

Releases

No releases published

Packages

No packages published

Languages