Code Blog

Displaying 1-1 of 1 result.
2016/06/01 OpenWRT

In order to keep the router in a stable condition I want to reboot it automatically every morning. This is a bit trickier than one would expect because the clock may get caught in an inifinite loop of reboots, see link below for more details. So the recommended way is to add a delay and update the clock before rebooting the router.

# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot

Good tips from: https://wiki.openwrt.org/doc/howto/cron