-
Notifications
You must be signed in to change notification settings - Fork 104
Automatically restarting the scoreboard for a new day
If you want to leave your scoreboard running all the time, you'll probably want to restart your scoreboard some time after midnight to start displaying information about the new day. This is an incredibly easy task by creating a cron job!
I will assume you've created the nifty systemd service script for starting your scoreboard when you boot your Pi. This gives us a very simple to use command for restarting the script! sudo systemctl restart mlb-led-scoreboard
is all we need to use in our crontab!
crontab -e
If you get a prompt asking for what kind of editor you would like to use, go ahead and pick your favorite editor to continue. You should see some documentation about how to use the cron file. Go ahead and add this line to the end of it.
0 4 * * * sudo systemctl restart mlb-led-scoreboard
That's it! In the above example, the scoreboard will restart every day at 4:00am. Since you'll want to restart the scoreboard every day, you only have to worry about the first two numbers. The first number is the minute, the second number is the hour.