Summary
Schedule rebooting a system is often used to clean the cache of the system data, system junk or to enhance the stability of the running of a system. During using the MyPBX phone system, some of the users would like to setup schedule rebooting the system automatically. In this case, users can login via SSH to setup the schedule reboot configurations.
Description
Note: Before you can login via SSH, users need to login web GUI and go to LAN settings page to enable the SSH.
Configuration file path: /persistent/etc/autoreboot/global.conf
Note: there is a default file /persistent/etc/autoreboot/global.conf.bak, please execute ‘mv global.conf.bak global.conf’, and then edit the contents
Configuration file format:
starttime=03:00
setinterval=0
daily=no
weekly=no
dateofweek=7
monthly=no
dateofmonth=1
Explanation
starttime is the option to setup the reboot time. Time format is 00:00, but not 8:55 or 12:5
setinterval is the option to setup the reboot interval. Set setinterval to -1 to disable autoreboot.
daily is the option to setup reboot every day or not
weekly is the option to enable or disable reboot every week. The value can be yes and no. If yes, the system will auto reboot every week on the dataofweek specified.
dateofweek is the option to setup the day of the week to reboot the system. The value can be from 1 to 7. 1 = Monday, 2= Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6=Saturday, 7 = Sunday.
monthly is the option to setup enable or disable reboot the system every month. The value can be yes and no. If yes, system will auto reboot every month on the dateofmonth specified.
dateofmonth is the option to setup the date of the month to reboot the system.
Priority sequence for the schedule reboot options:
Weekly, Daily, Monthly and setinterval
Example:
Below will show an example to schedule reboot the MyPBX every day at 3:00 AM.
Step 1, Login web GUI with admin user and go to LAN settings page to enable SSH
Step 2, Using SSH client like putty.exe to login MyPBX command line interface
Step 3, go to directory /persistent/etc/autoreboot/
Step 4, there is a file named global.conf.bak by default, execute the command ‘mv global.conf.bak global.conf’ to rename the file to global.conf. If you couldn’t find such a file, just create one and name it as global.conf.
Step 5, Edit the file global.conf to be the same as below
starttime=03:00
setinterval=0
daily=yes
weekly=no
dateofweek=7
monthly=no
dateofmonth=1
Step 6, Save the file global.conf and reboot the MyPBX.
Step 7, Login again via SSH and execute command ‘cat /tmp/autoreboot.log’ to check if the schedule reboot has been configured correctly or not. After you execute the command, you will be able to find out the next reboot time.
Appendix
SSH session logs for the example to schedule reboot the MyPBX every day at 3:00 AM.
----------------------------------------------------------------------------------------------------------------
login as: root
root@192.168.4.141's password:
BusyBox v1.4.1 (2012-11-13 21:29:17 CST) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:~> cd /persistent/etc/autoreboot/
root:/persistent/etc/autoreboot> ls
global.conf.bak
root:/persistent/etc/autoreboot> mv global.conf.bak global.conf
root:/persistent/etc/autoreboot> ls
global.conf
root:/persistent/etc/autoreboot> vi global.conf
starttime=03:00
setinterval=0
daily=yes
weekly=no
dateofweek=7
monthly=no
dateofmonth=1
~
~
~
root:/persistent/etc/autoreboot> reboot
login as: root
root@192.168.4.141's password:
BusyBox v1.4.1 (2012-11-13 21:29:17 CST) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
root:~> cat /tmp/autoreboot.log
lasttask=1225
type=1
nexttask=1226
starttime=03:00:00
root:~>
17 Comments