# 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
sleep 70
does this value halt the router for 70 seconds (before it actually turns on)?
No, it will be offline for whatever time it needs to shut down, pass through its bootloader and boot again. It will just wait 70s before doing anything (as in invoking the reboot procedure).
The concept of daily precautionary reboots however is flawed to begin with, either your router and its firmware are stable - then it doesn't need to be rebooted just in case, or it's not - in which case it's defective.
Yes - and cron isn't that exact in my experience anyway - with that entry, the reboot will take place at 4:30ish - it could be exactly 4:30 ... or a few seconds later, or even earlier if you measure against an atomic clock with the precise time
Do you really need to reboot the router at EXACTLY 4:30am? down to the second?
yes i need to reboot daily as these AP are public (with no security)
sometime the devices has problems with the wifi
fresh reboots daily almost solves all problems
I know you say you need to reboot daily ... I asked if the reboot time needs to be EXACTLY 4:30 .. i.e 4:31 is no good
Also, rather than rebooting, you could restart just the wifi - /sbin/wifi reload - I have a device I used to reboot like you do, but found that it's really only the wifi needs restarting
Just to throw this out there... why are you scheduling daily reboots? As a general rule, this should not be necessary. And if it is necessary because your router is experiencing issues, you are better served by solving the root cause of those problems rather than masking it by simply rebooting the router.
Usually OpenWRT solves the memory leak faults original firmwares have from time to time that usually makes the device stop in a couple of days. And memory leaks is usually solved with a reboot.
The other reason I have heard to make daily reboot is to remove “daily malwares” that lives in the memory. But just using a modern openwrt version that still is updated and has a “healthy setup”, then malware is not very common topic in this forum?
And network linux based devices/servers are kind of supposed to be run 24/7 which makes a daily reboot strange to begin with.
I had for about 10years ago a router that loosed the speed all the way down to 0 over a couple of days. But I simply used a power socket day timer and cut the power every night to solve the issue. That is probably the easiest solution for a daily reboot that doesn’t care of this cron “back to the future” paradox. But you should still let it run dry of electricity for at least 30seconds so the memory is cleared.