What's new

Scheduled Restarts

  • 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!

Cliff McLoughlin

New Around Here
Hi

Is there any way to schedule my AC68U to restart once a week or once a day? If it involves a script could you please give me a 'dummy's guide' to setting it up?

Thanks

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

With putty the above will reboot the router ever Thursday at 6am

Code:
ls -l /jffs/scripts/services-start
cat /jffs/scripts/services-start

this will check if code saved and used on boot


http://www.openjs.com/scripts/jslibrary/demos/crontab.php
if you want a diffrent day/time the above will help you
 
Thanks for the help. Unfortunately I seem to be missing something as after over 5 days my router has not restarted.

As you can see from the screen capture (Asus Admin) I have enabled jffs scripts in Admin, System
Asus Admin.PNG


As there were 2 very similar but slightly different options suggested I tried each individually and then both together. So currently in my /jffs/scripts folder I have init-start

init-start.PNG


and the same in services-start.

I also ran chmod a+rx /jffs/scripts/* to make the scripts executable and ls -l shows both files as having permissions -rwxrwxrwx.

What am I missing?

Thanks

Cliff
 
run a "cru l" to make sure the job was added to cron.

Also after adding the to init-start, did you reboot for the cron entry to be added?
 
Thanks Calisro

I tried that and it isn't listed. So it doesn't appear to be getting added (and yes I did reboot)

I just now tried typing

/usr/bin/cru a scheduled_reboot "0 3 * * * reboot"

into putty and then cru l it shows up.

It looks like the scripts aren't working correctly.

I just realised that both scripts have the same cru name and changed one and rebooted. Now cru l is listing both. I'll see if the router restarts tonight

Thanks for the help
 
Code:
cat << EOF > /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a ScheduledReboot "0 6 * * 4 reboot"
EOF

In putty if you typed that line for line it will reboot ever thursday at 6am, Only time i seen this not work is IF it was not typed right or if the router was deleting JFFS on boot, Which was an old bug that has been long fixed.

IF you have done my way and the way that was link before mine it might be conflicting best to delete the jobs or format the JFFS and pick one to use

I been manual imputing the above code every-time I upgrade the FW and so far it always worked
 
Honestly if you need to have the router reboot every day or what ever maybe its time to consider another router that actually works for you. :rolleyes:
 
This old thread comes up in current Google searches for this issue, so I thought I'd comment.

The current version of the Asuswrt-Merlin firmware now has automated restarts / reboots built into the GUI. For some reason it took my eyes a long time to find it so I'll point it out. This feature is under the Advanced Settings / Administration / System tab. It is in the Miscellaneous section. See screen capture:
reboot.JPG
 
As to why reboots would be needed... I don't think I actually need them right now. But why not?

In another setting, I'm stuck with a worthless Comcast router that has to be rebooted daily to remain stable, so I've just made turning this setting on a habit...

Also - in this setting - I'm experimenting with whether or not reboots help or hinder connectivity and speed of my connection to a VPN server. Let's me connect each morning to the VPN network server that they currently think has the lowest load and is working best for my area. Looking to see if this is a good idea, or if I am better off keeping and holding indefinitely a VPN server that's proven. Of course, this is a new topic for another thread... but part of why I'm currently rebooting.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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