[Solved] Scheduled reboots and other log related questions

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

Murtaza12

Regular Contributor
I've been running Voxel's .60SF firmware on my R7800 for a while now, it's rock solid in terms of stability, no complaints whatsoever. I probably won't upgrade unless absolutely necessary, however my new ISP has this weird thing where it drops the PPPoE connection every 24 hours, however since I'm subscribed to static IP, the IP obviously doesn't change, it just terminates the session for like 10 seconds and then reconnects.

So, since I last rebooted the router at like 1 PM, it disconnects every day at 1 PM for 10-15 seconds (sometimes longer), and then reconnects shortly after, I want this to stop happening when everyone is awake, but because of my schedule, I can't stay up till 5 AM to reboot it myself.
Is there a NOT complicated way of scheduling a reboot at 5 AM everyday? Since I have my Raspberry Pi scheduled to reboot around that time as well.


The second reason I made this thread would be these lines I've noticed in the router logs:

[DoS Attack: ACK Scan] from source: 157.240.7.53, port 5222, Thursday, October 25, 2018 20:46:37
[DoS Attack: ACK Scan] from source: 110.93.194.81, port 443, Thursday, October 25, 2018 20:41:55
[DoS Attack: TCP/UDP Chargen] from source: 188.166.63.106, port 60829, Thursday, October 25, 2018 20:35:25

Now this happens quite often, and it's always in the logs, with a bunch of different IPs, whats kinda interesting is that the one that I've made bold is an IP address from my ISP.

Is this normal? I use CloudFlare's DNS if that matters.

All replies will be appreciated.

Thanks,
murtaza12
 
Last edited:

Voxel

Part of the Furniture
R7800 is known as a bit "paranoid" with such reports. Try to search this forum re: DoS Attacks. Just make such minimal self-protection actions as:

Disable "Respond to Ping on Internet Port" in Advanced->WAN Setup
Disable UPnP

and ignore this. Does not matter what DNS you are using.

Voxel.
 

Murtaza12

Regular Contributor
R7800 is known as a bit "paranoid" with such reports. Try to search this forum re: DoS Attacks. Just make such minimal self-protection actions as:

Disable "Respond to Ping on Internet Port" in Advanced->WAN Setup
Disable UPnP

and ignore this. Does not matter what DNS you are using.

Voxel.
Hey Voxel, thanks for replying.

Respond to Ping on Internet port is already disabled, and the only reason I had UPnP enabled is due to me having a gaming console (PS4) connected to the router. I'll disable it and see if it affects connectivity on the console in any way.
 

kamoj

Very Senior Member
You can create your own cron job to do that.
The easy way for you is to add the following line to /etc/rc.local
Code:
mkdir -p /opt/tmp/mycron/crontabs && echo "00 05 * * * reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron/crontabs -T $TZ

This should reboot your router at 5 AM every day.

Thanks.
Any advice about scheduled reboots?
 

Murtaza12

Regular Contributor
You can create your own cron job to do that.
The easy way for you is to add the following line to /etc/rc.local
Code:
mkdir -p /opt/tmp/mycron/crontabs && echo "00 05 * * * reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron/crontabs -T $TZ

This should reboot your router at 5 AM every day.
Didn't know cron works on the R7800, I've got my Raspberry Pi's scheduled reboots also working through cron.

Thanks!
 

kamoj

Very Senior Member
Some people say that cron is not working for the R7800, that you must install ssh and Entware to get it working. That is not true.

You can create your own cron job without even editing rc.local, by creating a new rc.local with these 3 commands:
Code:
echo 'mkdir -p /opt/tmp/mycron/crontabs && echo "0 5 * * * reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron/crontabs' >/etc/rc.local
echo 'exit 0' >>/etc/rc.local
reboot

You can restore your rc.local to original with this command:
Code:
\cp /rom/etc/rc.local /etc/rc.local
 
Last edited:

Murtaza12

Regular Contributor
Thanks to instructions and help from @kamoj

I've got scheduled reboots using cron on my R7800, and it restarts every day at 5 AM thanks to this. The lines mentioned by kamoj in Post #8 work flawlessly with Voxel's .61SF firmware.
 

kamoj

Very Senior Member
How to install a cron job to reboot your router once a week:

Pre-requisites:

  • A telnet client program
#1. Logon (From your web-browser):
http://www.routerlogin.net

#2. Enable Telnet:
http://www.routerlogin.net/debug.htm
Check (Set a tick in the box for) "Enable Telnet". (No apply needed)

#2. Login to the router using telnet:
Code:
telnet www.routerlogin.net

#3. Create your cron job, to reboot every monday morning at 4 am:
Code:
echo 'mkdir -p /opt/tmp/mycron/crontabs && echo "0 4 * * 1 reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron/crontabs' >/etc/rc.local
echo 'exit 0' >>/etc/rc.local
reboot

#4. You can "uninstall" the cron job by restoring your rc.local to original with this command:
Code:
\cp /rom/etc/rc.local /etc/rc.local
 
Last edited:

Murtaza12

Regular Contributor
Router did not reboot with recommended cron job.
Did you modify the cron command to test it?

The one provided by kamoj in the post above yours is for the router to reboot every MONDAY at 4 AM.
I have a similar one, except mine reboots every day at 5 AM, and it works just fine, and it has been for the past week.
 

vit5421

Regular Contributor
Yes i did for Friday at 5 am and enter the following:
echo 'mkdir -p /opt/tmp/mycron/crontabs && echo "0 5 * * 5 reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron/crontabs' >/etc/rc.local

Dont understand about 2nd and 3rd command
echo 'exit 0' >>/etc/rc.local
crond -c /opt/tmp/mycron/crontabs
 

thegr8anand

Occasional Visitor
Some people say that cron is not working for the R7800, that you must install ssh ant Entware to get it working. That is not true.

You can create your own cron job without even editing rc.local, by creating a new rc.local with these 3 commands (reboot is not needed):
Code:
echo 'mkdir -p /opt/tmp/mycron/crontabs && echo "0 5 * * * reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron/crontabs' >/etc/rc.local
echo 'exit 0' >>/etc/rc.local
crond -c /opt/tmp/mycron/crontabs

You can restore your rc.local to original with this command:
Code:
\cp /rom/etc/rc.local /etc/rc.local

Hi,

I have no knowledge of cron but have logged in using putty and telnet to the router. Tried to enter the commands from this post. error on 3rd command. What am i doing wrong? I want to reboot the router everyday at 5am.
 

Attachments

  • reboot.jpg
    reboot.jpg
    58.2 KB · Views: 415

kamoj

Very Senior Member
Just reboot the router after the first 2 commands.

(I will update the instruction)

Hi,

I have no knowledge of cron but have logged in using putty and telnet to the router. Tried to enter the commands from this post. error on 3rd command. What am i doing wrong? I want to reboot the router everyday at 5am.
 

vit5421

Regular Contributor
Thank you but its still not working, no reboot.
Dear Voxel, Is it possible to add "schedule reboot" as configuration option in user interface?
 

kamoj

Very Senior Member
First you have to wait until 5 AM for the router to reboot.

Can you show the output from these commands, please:

Code:
cat /opt/tmp/mycron/crontabs/root
cat /etc/rc.local
ll /tmp/ntp_updated
date
date -u
which reboot
which crond
echo $TZ

Thank you but its still not working, no reboot.
Dear Voxel, Is it possible to add "schedule reboot" as configuration option in user interface?
 

vit5421

Regular Contributor
Lol, i have change the time to check.
Here is the output:

[email protected]:/$ cat /opt/tmp/mycron/crontabs/root
31 9 * * 7 reboot
[email protected]:/$
[email protected]:/$ cat /etc/rc.local
mkdir -p /opt/tmp/mycron/crontabs && echo "31 9 * * 7 reboot" >/opt/tmp/mycron/crontabs/root && crond -c /opt/tmp/mycron
/crontabs
exit 0
[email protected]:/$
[email protected]:/$ ll /tmp/ntp_updated
-rw-r--r-- 1 root root 0 Nov 11 09:29 /tmp/ntp_updated
[email protected]:/$
[email protected]:/$ date
Sun Nov 11 10:01:22 GMT 2018
[email protected]:/$
[email protected]:/$ date -u
Sun Nov 11 16:01:36 UTC 2018
[email protected]:/$
[email protected]:/$ which reboot
/sbin/reboot
[email protected]:/$
[email protected]:/$ which crond
/usr/sbin/crond
[email protected]:/$
[email protected]:/$ echo $TZ
GMT+6GMT,M3.2.0/2:00,M11.1.0/2:00
[email protected]:/$
[email protected]:/$
 

kamoj

Very Senior Member
I suggest you use "0" instead of "7" for sunday, or at least "0,7", since I'm not sure about this cron.
Next time you test, set a reboot time a little longer in the future, at least 5 minutes.
 

vit5421

Regular Contributor
It works now, Tada. Thank you very much. So, reboot was required with no 3rd original command and 7 is not valid day for Sunday.
One more stupid question from newbie. The cron job will not be saved in backup configuration, Right?
 

Sign Up For SNBForums Daily Digest

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