Set Reboot every Night? How

Hi guys,
While sleeping i want my router to reboot automatic every morning .

How can i set this command?

Full command for reboot at 4 .00 clock in the morning would help me a lot.

Does anybody how to set it... waiting your replies.

wiki?

3 Likes

Is there a specific reason you feel you need to do this? It should not be necessary to reboot your router under most normal circumstances unless there is some very specific condition that requires it. Often, it is better to address the root motivation directly (so for example, if you have a PPPoE session that expires, you can use a cron job to restart it, rather than restarting the entire router).

2 Likes

restarting it new , it performs better. Everything is smoother. Which command do i need to type?

Would you mind reading the answers that you get?
2nd posting in this topic contains all you need.

3 Likes

Is this your impression, or is it backed up by actual speed or latency measurements and/or qualified by specific, repeatable, demonstrable problems.

Assuming that your issues are indeed demonstrable/measurable, you can choose to reboot every night, or you can try to figure out why it is even an issue in the first place. Maybe your device is not properly configured, or maybe it is underpowered. Or maybe there isn't really an issue. But it is not normal to need a daily reboot.

I say: It should not be necessary to do a daily reboot. However, I consider it a good precaution, because there are sometimes (or usually) some programs to behave better from a fresh restart. I.e. they might have some memory leakage.
Or, it is just to recover from a permanent network connection loss, because of some 'hanging' hardware, i.e. 3g/4g-modem.

Why don't you run top for example every 24 hours and check for yourself if memory leaks is the case. And reporting your finding if any.

It isn't best practice to reboot unless you have
diagnosed a problem and have no other solution

1 Like

There are several other reasons, too, like improper handling of IP-change on the active (W)WAN, causing connection to hang.
Or a simple OOM crash on limited devices, i.e. when running squid-cache.
In case, it is a remotely installed device, without remote login, you have a problem.

There is always a difference between theoretical optimum, and long time experience.

To keep a long discussion short: Does the daily reboot do any harm ?

Not really, except you are masking a problem without trying to understand or solve it.

If the problem is random and not dependent on uptime then a reboot will achieve nothing

3 Likes

If you are on VDSL/ADSL the far end will assume that bad line quality was the cause of the resulting disconnect and will restart the training process, so you may end up with fairly slow line speeds.

5 Likes

I want to second @mbo2o - yes, the harm is to the community.

OpenWrt users generally have uptimes of weeks (or months) with no problems. If you observe problems that occur after a couple days of operation, the developers would really like to hear about it. (In fact, it's a matter of pride: they intend that their software work reliably forever.)

You don't have to diagnose it - simply reporting your observations is good enough. It's OK to make a report that says, "I'm using package X, Y, and Z, and it works great for the first few days, but then I see <list of symptoms...>"

And if there's no fix forthcoming, you certainly can resort to nightly rebooting Thanks.

6 Likes

crontab -e
0 5 * * * /sbin/reboot

This command will reboot your router every morning.

1 Like

This can lead to reboot loops.
The answer is on the second post.

3 Likes

Buy something like this:

Have it lose power while you're sleeping, then turn back on after that. My father did this for a while when we had an Xfinity modem that was acting up, so he had it lose power at 3 AM every "night". (We often had to reboot it ourselves when it acted up, so that's why we made it automatic.)

It's not a lamp, you know. There is a proper way to restart a router (or any device with a CPU for that matter), and there is no need to buy anything.

The answer is already mentioned in the second post.

2 Likes

I was just mentioning one method. Besides, while that may hold true for this users router, the 2 I have, do not have any shutdown switches/buttons/etc, and the only way to power them down is to unplug them. They aren't weird off-brands either, they are very common Linksys routers.

And yes, there is no need to buy anything, however if this is how someone wants to do it, then these outlet timers are neat little devices, and can be pretty useful imo.

I think you missed the point.

If you are running openwrt on a router you can schedule a reboot for anytime you like in software . There is no need to press any switches or buttons at all. Fully Automated.

Sure an ISP router etc might not and a timer switch is needed.

4 Likes

...and I'd still consider any device that needs daily rebooting broken and up for immediate disposal.

3 Likes

A reboot yes, but a power cycle no. In my experience sometimes the more closed source wifi chips seem a little flaky after a long time (I have a WRT1900acs and after weeks it can get a little flaky with my android phones, nothing really debuggable, they just stop retaining their association for very long, a reboot doesn't help, but a power cycle does, so every several weeks I'll just "try turning it off and on again" :wink: There is not much you can do about it because of lack of support from Marvell, and a restart doesn't necessarily put the hardware into the same state that a power cycle does. So sometimes the light switch isn't a bad idea.

in general though I agree with the idea that it's best to report problems because if you don't report them then they really are unlikely to get fixed.