Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5908

Troubleshooting • Re: Pi Model B correct way to first time boot after Imager?

$
0
0
I now wish to start the script and want it to run 24/7 at 5min intervals, but I am not sure this will do that?
"add the following line in your crontab -e:
2 5 * * * ~/solis/solis.sh > /dev/null
@reboot sleep 123 && ~/solis/solis.sh > /dev/null"
Google seemed to imply it was a once a day command?
Google is correct for a change!

The first line will run solis.sh at 05:02 every morning.
The second line will run it about 2 minutes after the Pi has booted.

I don't know what that solis.sh script does. It might sit there doing something every 5 minutes. But to use cron to run something every 5 minutes you'd use this line

Code:

*/5 * * * * ~/solis/solis.sh >/dev/null
Also the ">/dev/null" on the end means any output from the script is dropped silently. I tend to make it log to a file like this

Code:

*/5 * * * * ~/solis/solis.sh >~/solis/solis.sh.log 2>&1
The ">~/solis/solis.sh.log" writes the normal output to that file. The "2>&1" means write any error messages to the same place.

Statistics: Posted by rpdom — Fri Dec 13, 2024 12:47 pm



Viewing all articles
Browse latest Browse all 5908