tsunami2311
Senior Member
IS this possible if so if so can i get pointed in the correct direction as I would like to make router reboot once week at certian day and time, if at all possible
Hi,IS this possible if so if so can i get pointed in the correct direction as I would like to make router reboot once week at certian day and time, if at all possible
Which means: Reboot every Sunday at 6:00am./usr/sbin/cru a reboot "0 6 * * 0 reboot"
You should read the section about user scripts in Merlin's Wiki...To have the cron job it back on a reboot you might want to add this command into the services-start user script in the /jffs/scripts folder.
350 admin 1416 S syslogd -m 0 -S -O /tmp/syslog.log -s 512 -l 7
You should read the section about user scripts in Merlin's Wiki...
As your router runs a kind of linux (like DD-WRT does as well) you should make yourself familiar with Linux scripting!
Regarding Logging: Not sure what you ask here.
Logs are created in RAM, but reach only a certain size which is defined in the startup of the logging service.
The default setting is:
This means that after 512 KByte the logging will start overwriting (or better deleting) the old entries.Code:350 admin 1416 S syslogd -m 0 -S -O /tmp/syslog.log -s 512 -l 7
With kind regards
Joe
cat << EOF > /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a ScheduledReboot "0 6 * * * reboot"
EOF
chmod a+rx /jffs/scripts/services-start
/jffs/scripts/services-start
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 if I want every tuesday of ever week at 6am it would be
/usr/sbin/cru a ScheduledReboot "0 6 2 * 1 reboot ?
And once month would be on tuesday at 6am
/usr/sbin/cru a ScheduledReboot "0 6 2 1 * reboot ?
I thank you I will give it ago, but i thinking it might not be worth it at this point I will see in the coming weeks if I really need to have it do this rebooting
Hi,
Yes, this is possible, allthough it's really not necessary!
Reapeting myself:
With kind regards
Joe
what cmd can I run to verify that a reboot is scheduled?
chief@ASUS_RT-N66U:/tmp/home/root# [B]cru l[/B]
0 4 * * * /jffs/scripts/restart-wlan.sh #RestartWifi#
0 20 * * * /jffs/scripts/ledsoff.sh #LEDsoff#
0 8 * * * /jffs/scripts/ledson.sh #LEDson#
chief@ASUS_RT-N66U:/tmp/home/root# [B]crontab -l[/B]
0 4 * * * /jffs/scripts/restart-wlan.sh #RestartWifi#
0 20 * * * /jffs/scripts/ledsoff.sh #LEDsoff#
0 8 * * * /jffs/scripts/ledson.sh #LEDson#
It's cool you can script the LEDs . . what's the command for on/off? I see the script name but I assume there's a command (like restart_wireless).
I can just add that to my services-start file . . (I already have the wifi restarting daily).
Hi,It's cool you can script the LEDs . . what's the command for on/off? I see the script name but I assume there's a command (like restart_wireless).
I can just add that to my services-start file . . (I already have the wifi restarting daily).
#!/bin/sh
/bin/nvram set led_disable=1
/sbin/service restart_leds
exit $?
#!/bin/sh
/bin/nvram set led_disable=0
/sbin/service restart_leds
exit $?
#!/bin/sh
/usr/bin/logger -t START_$(basename $0) "started [$@]"
SCRLOG=/tmp/$(basename $0).log
touch $SCRLOG
echo "START_$(basename $0) started [$@]" >> $SCRLOG
/usr/sbin/cru a RestartWifi " 0 4 * * * /jffs/scripts/restart-wlan.sh" >> $SCRLOG
wait
[B]/usr/sbin/cru a LEDsoff " 0 20 * * * /jffs/scripts/ledsoff.sh" >> $SCRLOG[/B]
wait
[B]/usr/sbin/cru a LEDson " 0 8 * * * /jffs/scripts/ledson.sh" >> $SCRLOG[/B]
wait
if [ "$?" -ne 0 ]
then
echo "Error in services-start execution! Script: $0" >> $SCRLOG
#exit $?
else
echo "Services-start execution OK. Script: $0" >> $SCRLOG
#exit 0
fi
/usr/bin/logger -t STOP_$(basename $0) "return code $?"
exit $?
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!