-
Notifications
You must be signed in to change notification settings - Fork 24
Part 5. Automatically Launch on Boot
To automatically launch our scripts on boot, we will use crontab.
$ crontab -e
At the end of the file that opens, add the monitor_reboot script and the launch_process script. Specify the full path. For example, you will add a single line that looks something like the following (with your specific paths):
@reboot python /home/pi/weather/monitor_reboot.py && /home/pi/weather/launch_process.sh
Notice the monitor_reboot script is followed by "&&". This specifies that the monitor_reboot script should complete before the next command runs. If there is a power outage, it may take a few minutes for your network connection to be restored. After the delays specified in the monitor_reboot script expire, status updates will be sent to your dashboard and your process will be launched.
Once this is in place, everything will be automated. Every time your Pi boots, your process dashboard will update and your process will launch and be monitored.
Initial State (https://www.initialstate.com)
(c) 2019 Initial State Technologies, Inc.