How to Schedule a Reboot in MyPBX

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:~>

Have more questions? Submit a request

17 Comments

  • 1
    Avatar

    Teymur, nice job!

  • 1
    Avatar

    Teymur, According to your description, the issue might related to the onboard batatery which used to provide system time for the MyPBX, I would suggest you to create a ticket for these issues and our support engineers will check and see what is the root cause for these issues.

  • 1
    Avatar

    setinterval = 1 means schedule reboot every one day, daily=yes means reboot every day also. 

    Your setitngs looks fine, the autoreboot.log show it was reboot on March 13 and will reboot on March 14, maybe you can check the system uptime and check it reboots or not.

  • 0
    Avatar

    I think you need to setup the setinterval as 1, try and see if that help.

    Edited by Oscar Colka
  • 0
    Avatar

    Hi Pasquale,

    First answer: Sorry, but it is not yet available to schedule a daily reboot on Yeastar S100;

    For the "new attack" it is probably caused by there some SIP devices try to register SIP extensions and send SIP packets two often and was detected as an attack. Please check your firewall and pay attention to the security of your S100;

    For your trunk lost connection, please check the firmware version of your S100; If it is not the latest one(30.4.0.6), I would suggest you to update to latest version and check again. Before your upgrade, please backup your configurations.

    If upgrade to latest version doesn't help, we may need your help to capture SIP logs for the time when registered correctly and when doesn't work. Then submit the SIP logs to your previous submited ticket.

  • 0
    Avatar

    tks!

  • 0
    Avatar

    hi to all....

    FIRST QUESTION

    there is a way to schedule a daily reboot on yeastar s100?

    i've a big problem: sometimes yeastar receives "new attack" and i lost connection to our voip trunks. if i reboot all returns to normaly.

    SECOND QUESTION

    Why trunks lost connection?

  • 0
    Avatar

    Thanx

  • 0
    Avatar

    I tried twice, alas, no reboot performed, uptime was not reset. Additionally i'm pinging device during tests.

    Tonight will try again.

    Additional question:

    after reboot PBX changes time approx. -25 minutes to current. For ex. if reboot was at 10:30 then clock becomes after reboot 10:05. After 5 minutes PBX syncing time to local NTP time server and everything ok. During this period after reboot (5 minutes) no call logs are registered, no possibility to logon via SSH (says incorrect password). After 5 minutes everything is ok.
    Can you comment this issue?

  • 0
    Avatar

    And if setinterval=1 means every minute then i'll get infinite boot-loop? )))

  • 0
    Avatar

    How do I create the global.conf if its not there? Can you give example commands pls? 

    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.

    Cheers

    Bernie

  • 0
    Avatar

    Here it is

    BusyBox v1.4.1 (2012-04-11 15:35:00 CST) Built-in shell (msh)
    Enter 'help' for a list of built-in commands.

    root:~> cat /persistent/etc/autoreboot/global.conf
    starttime=04:50
    setinterval=0
    daily=yes
    weekly=no
    dateofweek=7
    monthly=no
    dateofmonth=1

    root:~> cat /tmp/autoreboot.log
    lasttask=0314
    type=1
    nexttask=0315
    starttime=04:50:00
    root:~>

     

    What does setinterval mean? Is it delay between starttime and next attempt to reboot? What unit should be used? For example, may be i have to try set daily=no and at the same time setinterval= "smth equal to 24hours"?

    Edited by Teymur Bagirov
  • 0
    Avatar

    autoreboot.log is the log for the auto-reboot feature. Try post your global.conf and the autoreboot.log here then we can test our side and see what would be the problem.

  • 0
    Avatar

    Thank you.

    But i'd like to investigate, why built-in reboot not working? May be there are some logs that can help?

  • 0
    Avatar

    I fixed auto reboot with external windows pc.

    Download plink.exe (putty package)

    create .bat file with 2 lines

    echo y | c:\cmd\PLINK.EXE -ssh -P 8022 root@192.168.4.111 -pw mypassword exit
    c:\cmd\PLINK.EXE -ssh -P 8022 root@192.168.4.111 -pw mypassword reboot

    and create scheduled task at specific time.

    That's it.

    First command accepts key from pbx in order to eliminate prompt for second command, the second performs reboot.

  • 0
    Avatar

    Hi,
    All is done accordingly to your instruction.
    Time is set to 04:50.
    But no reboot is performed.
    autoreboot.log shows correct time.
    V4 2.16.994.88

  • 0
    Avatar

    Hello Bernie, 

    You can use command 'touch' to create a file, 

    touch global.conf

     

    After create the file, you can use vi to edit the file, actually, you can use 'vi' to create a file as well, see below link for more detail about Linux command 'vi'

    http://www.washington.edu/computing/unix/vi.html

     

    Regards,

Please sign in to leave a comment.