What's new

Scheduled reboot set up issue

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

tsunami2311

Senior Member
So following the below info using 3.0.0.4.270.26 To setup a scheduled rebooting i ran into issue


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


Putty closes the moment I hit open I see cmd for second and then it closes

I trying to setup this command
* 6 * * 1 reboot
for every Monday at 6am for the router to reboot but i cant even get putty to open
 
Last edited:
Hmm, actually I'm not sure if that will work... From the crontab(5) manpage:

Note that comments are not allowed on the same line as cron commands, since they will be taken to be part of the command.

So... It might work, but I'd remove the comment (the #ScheduledReboot# part) just to be safe.
 
I guess I'm really out of it tonight. :)

Your command will actually reboot the router each minute of 6am on Wednesday because you have a * specified in the minute field. The correct crontab entry should be:

Code:
0 6 * * 3 reboot
 
well i will find out tomorrow morning when i get up it if rebooted at 6am on Wednesday, if it didn't i will try 0 6 * *3 reboot

Only reason I even bothering with reboot command now is apparently the longer the router is up the slow wifi gets or at lest the 5g

I think it would be simple to just add the ability to schedule a reboot threw the gui, but i understand why merlin didnt do it
 
Last edited:
it didn't reboot at all, so i gonna try this again I went ahead an did the following

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

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


this is supposed to re-establish the job after reboot, and it is not every time i do manual reboot, the job is completely gone


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

to work i gathering the moment it reboot from that the job gona disappear. all the above commands are beeing done in putty


I got all these command from merlin him self in my original topic Am i doing something wrong? yes I read the wiki for user scripts it make no sense to me So if some one want to be nice could you please put step by step instructions on how to to get the router to reboot every week on certian day at 6am I would be grateful

I need the router to reboot cause 5g wifi connection after long enough periods with out reboots kills the 5g speed and reboot fixes that
 
Last edited:
Just to confirm, can you run:

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

and paste the results here.
 
will do i am currently doing

#!/bin/sh
cru a scheduled_reboot 0 6 * * 4 reboot

just to see if it even reboots tommorow at 6am if that reboots fine


but after doing this

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

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

And running

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

I get

ASUSWRT RT-AC66U_3.0.0.4 Sun Mar 17 20:49:36 UTC 2013
admin@RT-AC66U:/tmp/home/root# cru l
admin@RT-AC66U:/tmp/home/root# cat << EOF > /jffs/scripts/services-start
> #!/bin/sh
> /usr/sbin/cru a Scheduled_Reboot 0 6 * * 4 reboot
> EOF
admin@RT-AC66U:/tmp/home/root# chmod a+rx /jffs/scripts/services-start
admin@RT-AC66U:/tmp/home/root# /jffs/scripts/services-start
admin@RT-AC66U:/tmp/home/root# ls -l /jffs/scripts/services-start
-rwxrwxrwx 1 admin root 60 Jul 31 15:15 /jffs/scripts/services-start
admin@RT-AC66U:/tmp/home/root# cat /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a Scheduled_Reboot 0 6 * * 4 reboot
admin@RT-AC66U:/tmp/home/root#

But the moment I reboot router

ASUSWRT RT-AC66U_3.0.0.4 Sun Mar 17 20:49:36 UTC 2013
admin@RT-AC66U:/tmp/home/root# ls -l /jffs/scripts/services-start
ls: /jffs/scripts/services-start: No such file or directory
admin@RT-AC66U:/tmp/home/root# cat /jffs/scripts/services-start
cat: can't open '/jffs/scripts/services-start': No such file or directory
admin@RT-AC66U:/tmp/home/root#

I do appreciate the help
 
Last edited:
From Merlins change log for

3.0.0.4.372.30:

- FIXED: JFFS2 could get reformatted again at each subsequent reboots.

Seems that the jffs partition is getting reformatted after reboots.
 
ok i did that and the stuff seem to still be there but when i do crontab - l after reboot



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

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


0 6 bin cifs1 cifs2 dev etc home jffs lib mmc mnt opt proc rom root sbin sys tmp usr var www bin cifs1 cifs2 dev etc home jffs lib mmc mnt opt proc rom root sbin sys tmp usr var www 4 reboot #Scheduled_Reboot#

when i used ls -l /jffs/scripts/services-start
cat /jffs/scripts/services-start

So deleted the cron and re did it as
cat << EOF > /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a ScheduledReboot "0 6 * * 4 reboot"
EOF

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

and when I did

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

ASUSWRT RT-AC66U_3.0.0.4 Wed Jul 24 06:22:57 UTC 2013
admin@RT-AC66U:/tmp/home/root# ls -l /jffs/scripts/services-start
-rwxrwxrwx 1 admin root 61 Jul 31 16:55 /jffs/scripts/services-start
admin@RT-AC66U:/tmp/home/root# cat /jffs/scripts/services-start
#!/bin/sh
/usr/sbin/cru a ScheduledReboot "0 6 * * 4 reboot"
admin@RT-AC66U:/tmp/home/root#

I am gathering this is how it should show? hopeful it reboots every Thursday at 6am now
 
Last edited:
Thank you for all the help given special vdemarco

The Router Now reboots correctly AND no longer delete the commands upon doing so.
 
I try to do it but see
ASUSWRT-Merlin RT-AC68U_3.0.0.4 Sat Jun 7 16:32:17 UTC 2014
admin@RT-AC68U:/tmp/home/root# cat << EOF > /jffs/scripts/services-start
> #!/bin/sh
> /usr/sbin/cru a ScheduledReboot "0 5 * * * reboot"
> EOF
-sh: can't create /jffs/scripts/services-start: nonexistent directory

what did I wrong?
 
I try to do it but see
ASUSWRT-Merlin RT-AC68U_3.0.0.4 Sat Jun 7 16:32:17 UTC 2014
admin@RT-AC68U:/tmp/home/root# cat << EOF > /jffs/scripts/services-start
> #!/bin/sh
> /usr/sbin/cru a ScheduledReboot "0 5 * * * reboot"
> EOF
-sh: can't create /jffs/scripts/services-start: nonexistent directory

what did I wrong?
Try:
Code:
mkdir /jffs/scripts
and try again. If that doesn't work you don't have a /jffs partition. I which case go to Administration > System > Persistent JFFS2 partition

Set Enable JFFS partition to Yes
Set Format JFFS partition at next boot to Yes
Click Apply then Reboot the router.

mkdir /jffs/scripts

It should then work.
 
To:ColinTaylor

I try to run:
mkdir /jffs/scripts

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Sat Jun 7 16:32:17 UTC 2014
admin@RT-AC68U:/tmp/home/root# mkdir /jffs/scripts
mkdir: can't create directory '/jffs/scripts': Read-only file system

How I understand I have /JFFS partition but it isn't writable
 
I try to run:
mkdir /jffs/scripts

ASUSWRT-Merlin RT-AC68U_3.0.0.4 Sat Jun 7 16:32:17 UTC 2014
admin@RT-AC68U:/tmp/home/root# mkdir /jffs/scripts
mkdir: can't create directory '/jffs/scripts': Read-only file system

How I understand I have /JFFS partition but it isn't writable

If it's not writable then it means it's not enabled and mounted. /jffs itself is only the mount point located in read-only flash. Once mounted, the scripts and config directories will automatically appear after a reboot, and you will be able to write to it.
 
I tried
1.Enable JFFS + Format JFFS + Apply,then reboot.
2. Enable JFFS + Format JFFS + Apply, then reboot 2 times.
3. Disable JFFS + Disable Format JFFS + Apply, then reboot. Enable JFFS + Format JFFS + Apply, then reboot.
but I see every time the same
-sh: can't create /jffs/scripts/services-start: nonexistent directory
:(
 
I tried
1.Enable JFFS + Format JFFS + Apply,then reboot.
2. Enable JFFS + Format JFFS + Apply, then reboot 2 times.
3. Disable JFFS + Disable Format JFFS + Apply, then reboot. Enable JFFS + Format JFFS + Apply, then reboot.
but I see every time the same
-sh: can't create /jffs/scripts/services-start: nonexistent directory
:(

Enable the option to format it. Then, before rebooting, run the following over ssh:

Code:
nvram unset jffs2_size
nvram commit
reboot
 

Latest 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