thealphonso
Occasional Visitor
What about if I want 2 reboots in one day, one at 00:05 and another at 06:05, should I create 2 separate scripts for it?
Hi,What about if I want 2 reboots in one day, one at 00:05 and another at 06:05, should I create 2 separate scripts for it?
What about if I want 2 reboots in one day, one at 00:05 and another at 06:05, should I create 2 separate scripts for it?
I got this error:
-sh: can't create /jffs/scripts/services-start: nonexistent directory
Actually, here's an easy way for you to create that schedule.
1) Enable JFFS + Format JFFS + 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:
Code:cat << EOF > /jffs/scripts/services-start #!/bin/sh /usr/sbin/cru a ScheduledReboot "0 6 * * * reboot" EOF
Set 0 (minutes) and 6 (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:
Code: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:
Code:rm /jffs/scripts/services-start cru d ScheduledReboot
Okay, this seems straight forward but something isn't working right for me. When I Telnet in I am at admin@RT-N66U:/tmp/home/root# and I have typed these commands and I have also copied them in but I also get the error
sh: can't create /jffs/scripts/services-start: nonexistent directory
I'm new to this and I have been trying to read/search but am I missing something? I can find the jffs directory, I can see the services-start script, what am I doing wrong?
For me, it might be necessary. I was having extremely slow LAN speeds (~200 KB/s instead of the proper ~2.5 MB/s). A reboot fixed it. That's why I searched on how to automate reboots, because I'll take a hammer to this router before I make myself a slave to rebooting it manually. (Sarcastic comments that we should do exactly that by monitoring a clock notwithstanding.)Yes, this is possible, allthough it's really not necessary!
I got that error when using the commands above. It worked when I simply surrounded the first EOF with single quotes. That is, instead of this:I got this error:
-sh: can't create /jffs/scripts/services-start: nonexistent directory
cat << EOF > /jffs/scripts/services-start
cat << 'EOF' > /jffs/scripts/services-start
ls /jffs/scripts
cru l
Actually, here's an easy way for you to create that schedule.
1) Enable JFFS + Format JFFS + 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:
Code:cat << EOF > /jffs/scripts/services-start #!/bin/sh /usr/sbin/cru a ScheduledReboot "0 6 * * * reboot" EOF
Set 0 (minutes) and 6 (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:
Code: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:
Code:rm /jffs/scripts/services-start cru d ScheduledReboot
Actually, here's an easy way for you to create that schedule.
1) Enable JFFS + Format JFFS + 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:
Code:cat << EOF > /jffs/scripts/services-start #!/bin/sh /usr/sbin/cru a ScheduledReboot "0 6 * * * reboot" EOF
Set 0 (minutes) and 6 (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:
Code: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:
Code:rm /jffs/scripts/services-start cru d ScheduledReboot
So far I always refused to implement a webui interface to schedule reboots because if I do, then someone will ask to make the scheduling more flexible to support two different scheduled reboots. Then someone else will ask for multiple reboot schedules. Then, someone else will ask for the feature allowing him to run a script before doing the reboot. And so on... Since I want to avoid feature bloat in my firmware, I decided to leave it to users to do it through scripting. I'm sure someone will be able to guide you through the details on how to do it - it's simpler than you might think.
http://forums.smallnetbuilder.com/showpost.php?p=68429&postcount=7What would the script be for a nightly reboot?
I have two AC68U routers and one becomes non-responsive every 2-3 days. A nightly reboot will eliminate this issue.
thanks!
I followed this advice to the letter--multiple times--and never managed to get my router to reboot on a schedule.
cru l
cat /jffs/scripts/services-start
ls -l /jffs/scripts
Hi!
Is it possible using script to reboot the connection of 4G USB-modem (on WAN №2) on schedule (without rebooting the router), for example, every day at 00:01 (AC68U Firmware: 376.48_1)? Thanks.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!