What's new

how to make asus router automatically reboot every day?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

hasuboy

Occasional Visitor
merlin or stock firmware web gui did not provide this feature, i heard that can use the script to achieve, how to do it? best to have detailed steps, thanks all.
 
thank you for your information. BTW, i can not access google. you know, state law......
This is how I did it with Merlin. Note that these steps are not described by me, just used and saved them in my notes. I should and would have given you the source if I could find it.

Scheduled Reboot

1) Enable JFFS + Format JFFS + Enable JFFS custom scripts and configs (if this option is present) + Telnet on the Administration -> System page, then reboot.
2) Download the software called Putty (should be easy to find on Google)
3) Using Putty, connect using the Telnet protocol to your router's IP (probably 192.168.1.1) Username and password are the same as for the webui.
4) Type the following, one line at a time:

cat << EOF > /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a ScheduledReboot "0 4 * * * reboot"
EOF

Set 0 (minutes) and 4 (hour) to the desired reboot time, for a daily reboot. Those arguments are:
"min hour day month week command"
After this you will be back to the prompt. Now run this:

chmod a+rx /jffs/scripts/services-start
/jffs/scripts/services-start

That will set up the cron job. Every time you reboot the router, the reboot task will be re-established.
To remove the task:

rm /jffs/scripts/services-start
cru d ScheduledReboot
 
Why would anybody have to reboot there router every day ??
 

Now i did not say (sic). No really i was just wondering because i have heard a few people that do this and wondered why. Sometimes i have gone the whole time between firmwares and never rebooted the router a single time.
 
This is how I did it with Merlin. Note that these steps are not described by me, just used and saved them in my notes. I should and would have given you the source if I could find it.

Scheduled Reboot

1) Enable JFFS + Format JFFS + Enable JFFS custom scripts and configs (if this option is present) + Telnet on the Administration -> System page, then reboot.
2) Download the software called Putty (should be easy to find on Google)
3) Using Putty, connect using the Telnet protocol to your router's IP (probably 192.168.1.1) Username and password are the same as for the webui.
4) Type the following, one line at a time:

cat << EOF > /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a ScheduledReboot "0 4 * * * reboot"
EOF

Set 0 (minutes) and 4 (hour) to the desired reboot time, for a daily reboot. Those arguments are:
"min hour day month week command"
After this you will be back to the prompt. Now run this:

chmod a+rx /jffs/scripts/services-start
/jffs/scripts/services-start

That will set up the cron job. Every time you reboot the router, the reboot task will be re-established.
To remove the task:

rm /jffs/scripts/services-start
cru d ScheduledReboot

Very detailed steps, thank you!
 
Now i did not say (sic). No really i was just wondering because i have heard a few people that do this and wondered why. Sometimes i have gone the whole time between firmwares and never rebooted the router a single time.

Reboot the router is because sometimes the router will appear some strange issues or unstable situations, usually change the setting will not work, and reboot the router is able to solve most of the problem. So let the router automatically reboot every day which allows the router maintain a good state.
 
Resurrecting an old thread!!!

Is it possible to set the restart for multiple times of the day by having multiples of this script?

/usr/sbin/cru a ScheduledReboot "0 4 * * * reboot"

For example:
/usr/sbin/cru a ScheduledReboot "0 4 * * * reboot"
/usr/sbin/cru a ScheduledReboot "0 8 * * * reboot"
/usr/sbin/cru a ScheduledReboot "0 12 * * * reboot"
/usr/sbin/cru a ScheduledReboot "0 16 * * * reboot"
/usr/sbin/cru a ScheduledReboot "0 20 * * * reboot"
 
Intervals would be cleanest. If you go with multiple tasks, then give different names to each of them (i.e. ScheduleReboot1, ScheduleReboot2, etc...)

I'm not sure if cru/crond support intervals however (this isn't a full-featured crond as you'd see in a server).
 
Thanks Merlin. I am using your firmware. I'll give it a try. Problem is my VPN uses a hostname for certain addresses that keep being blocked and the only way to refresh it is to reboot. I figure I may as well reboot ever 4 hours or during times when I know it's not critical so it stays refreshed. So you think the AC-68 with your firmware should support the interval cron job?
 
Thanks Merlin. I am using your firmware. I'll give it a try. Problem is my VPN uses a hostname for certain addresses that keep being blocked and the only way to refresh it is to reboot. I figure I may as well reboot ever 4 hours or during times when I know it's not critical so it stays refreshed. So you think the AC-68 with your firmware should support the interval cron job?

I don't know. The crond daemon used by Asuswrt and Asuswrt-Merlin in the same, it's a cut-down version provided by busybox. You would have to check the busybox documentation, or give it a try.
 
Just an FYI....there is a once a day reboot scheduler built into the gui now......
 
I don't know. The crond daemon used by Asuswrt and Asuswrt-Merlin in the same, it's a cut-down version provided by busybox. You would have to check the busybox documentation, or give it a try.

Thanks. I'll give it a try and report back if it works or not.
 
Just an FYI....there is a once a day reboot scheduler built into the gui now......

Thanks. I haven't updated to the newest version yet. Is it part of the stable release or the beta? Either way I'd like it to reboot several times throughout the day to avoid getting the texts at home telling me the VPN is down again because Netflix blocked another IP address.
 
Thanks. I haven't updated to the newest version yet. Is it part of the stable release or the beta? Either way I'd like it to reboot several times throughout the day to avoid getting the texts at home telling me the VPN is down again because Netflix blocked another IP address.
I picked it up in my fork from Merlin's release in November of last year, so I'd assume it's in all the releases since. Check on the Administration > System page.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top