Watchcat / rebooting?

Hi.

I would like to know if watchcat is like keep alive in dd wrt? I'd like to scheduling a rebooting every 3 days or 1xweek.. is it possible by that?
Thanks

Yes it is, been a while since i've used so i can't remember how much scheduling flexibility it has, but it's essentially the same.

There is an option for periodic reboot, other than rebooting on connectivity loss.
However you can achieve that without watchcat. -> https://openwrt.org/docs/guide-user/base-system/cron?s[]=reboot#periodic_reboot
Periodic reboot should not be needed and it would be best to find the root cause of your problem, rather than hiding them under the carpet. E.g a lot of files occupying space in /tmp

Thanks.
I've read the tuto, but I'm a novice so not sure about command and script.

As here : ( it's not all script to paste to command shell right? It contains explication?

# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot

No, you need to add this as a cronjob (or in scheduled tasks in Luci).

Exactly like that?

The lines starting with # are comments, so you can omit them.

The simplest way is from the web-gui:
http://router-openwrt-ip/cgi-bin/luci/admin/system/crontab
change router-openwrt-ip with your router hostname (in my case ArcherC7) or the IP address (something like 192.168.1.1)

or you can (from an ssh login) just run:

root@ArcherC7:~# crontab -e
This open a vi (text editor) session, just type "i" then paste this

# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot

ESC key, then type ":wq" ( ":" change to command mode then Write and Quit)

To check that's all is OK:
root@ArcherC7:~# crontab -l

# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot
1 Like

This topic was automatically closed 0 minutes after the last reply. New replies are no longer allowed.