How to set up a PBX to automatically receive and install backups

How to set up a PBX to automatically receive and install backups

Automatic Accept and Install of Backup Files

The nexMatrix PBX systems can automatically create and send backup files. This page documents the process to set up a second nexMatrix PBX system to automatically receive and install the backup files. The backup files will then be ready and available to apply to the system if needed.

Log In

Log in to the system as user 'pbxadmin'

Note that nothing in this process requires root access or even voip user. This can be done entirely by the end-user with just the pbxadmin credentials.

Set up ssh key

This will allow the target system to upload backup files using the pbxadmin user without needing a password entered in.

Create directory .ssh if it does not already exist

mkdir -p .ssh

Edit the authorized_keys file and add the public key of the source PBX. This key can be downloaded from the PBX on the page for setting up automated backups.

nano .ssh/authorized_keys

Copy the text of the key file as a single line in the authorized_keys file. If the file already exists and has other key data, put the new key on a separate line from the other keys. But do make sure that there are no line breaks in the data for a particular key.

Close the file with ctrl-x and save changes.

Ensure correct permissions for the authorized_keys file. Otherwise the ssh server will refuse to use it.

chmod 600 .ssh/authorized_keys

Create subdirectory to accept backup files into (optional) (recommended)

Setting up a subdirectory for backup files greatly simplifies the command needed to automatically install the backup files. The install instructions assume that you will create this backup directory and that it is named backups.

mkdir backups

Set up automatic install

Backup files in the pbxadmin/backups directory will not be seen by the PBX system and will not be available for restoring the system to. Set up a cron command to install the backup files to the proper location.

Decide on a time for the cron command to run. Create a cron timing string by listing the minutes, followed by the hour in 24-hour format, followed by three '*' characters - all of these components being separated by a space character.

For example, to run the command at 9:45 p.m. the cron timing string would be 45 21 * * *. I will use this timing string in the command below, modify it for your own timing requirements.

crontab -e

Add the following line to the end of the file:

45 21 * * * for i in /home/pbxadmin/backups/* ; do sudo /usr/local/bin/installNexMatrixBackup $i && /bin/rm $i ; done

This will install all backup files in the pbxadmin/backups directory and then delete the files from that directory so that they do not fill up the disk space.

Configure automatic purge of outdated backup files (optional) (recommended)

Backup files can take up quite a bit of disk space. In cases where backup files are being generated automatically, it is recommended to remove outdated backup files automatically also to prevent the disk space from becoming too full.

Automatic removal of older backup files can be configured from the PBX UI.

    • Related Articles

    • 9/16/2015 PBX-based DND

      Most IP phones have a built in DND (Do Not Disturb) feature.  If this feature is toggled "ON" from the phone, any call directed at that phone will return an unavailable message to the PBX, which usually causes the call to go directly to Voicemail. ...
    • How to Control Extension Forwarding Automatically using Timing Function

      Scenario:  Extension user wants their calls forwarded to a cell phone automatically, on a schedule based on day of week/time of day. These instructions are written with extension 105 as an example.  Replace 105 with the actual extension number you ...
    • nexMatrix Host Names and IP addresses

      nexMatrix SIP trunk service will connect to your IP PBX from one or more of these servers. You may need to whitelist these addresses and/or host names to allow unsolicited inbound traffic from them to your PBX on UDP port 5060 and whatever range of ...
    • How to install a Protel backup file if it is more than 100Mb in size

      For backup files that exceed 100 Mb in size, you will not be able to use the Protel GUI to upload and restore the backup if it was created on another PBX.  The constraints of HTTP don't allow for an upload that size.  You will need to use an FTP ...
    • Changing Network settings on a Protel PBX through CLI

      You should only use this method if you are unable to log into the PBX through its web-based administration interface.  For more information, read the PBX Initialization steps HERE   You will need to connect a USB keyboard to one of the USB ports on ...