cBrandon Community

General Category => Linux Fixes => Topic started by: branx86 on November 04, 2019, 10:44:14 AM

Title: Create a crontab startup script
Post by: branx86 on November 04, 2019, 10:44:14 AM
1. Create script nano WhateverNameyouChoose.sh
2. Put the text below in the top of the script:
#!/bin/sh
# launcher.sh
# navigate to home directory, then to this directory, then execute python script, then back home

cd /
cd home/pi/bbt
sudo python bbt.py
cd /

3.Make script an executable: chmod 755 WhateverNameyouChoose.sh
4. crontab is a background (daemon) process that lets you execute scripts at specific times.
   sudo crontab -e
  To make script start at reboot: @reboot sh /home/pi/WhateverNameyouChoose.sh >/home/pi/logs/cronlog 2>&1

reboot should be working.