Backups (VoIP)

Every system should have a good backup plan, even if it is printing all the setup screens. We will want a way to restore our configurations, should anything go wrong. Fortunately, this isn’t so difficult with TrixBox; but we will need some method of dealing with the backup files once they are created.
The Setup link in the FreePBX main menu leads us to a Backup and Restore menu. Using this tool we can create a variety of backup schedules to fit our requirements. At the minimum, a weekly backup of config files and voicemail files is suggested. If
voicemail is extremely important, then we can easily do a daily backup. However, we should keep in mind that a daily backup will create a new backup file every day and if we do not keep an eye on it, we could end up running out of disk space at some point.
We enter a name for our backup set and select which items we want to have backed up in the current set. Finally, we set a time to run the backup at. For a simple daily backup job, you can use the pull-down menu to select Daily (at midnight) as a pre-defined schedule.
tmp91-9_thumb
One of the easiest methods to handle remote backups is to FTP the backup file to a remote site. Assuming that you have a remote FTP site already set up, we will see how to modify the backup script to transfer the backup we set up earlier.
The actual backup is handled by a script named ampbackup.pl that is located in /var/lib/asterisk/bin. To add the lines for the remote backup, we edit the existing backup script with the following command:
nano /var/lib/asterisk/bin/ampbackup.pl
Before the last line of the file, we add the following code:
tmp91-10_thumb
We should make sure to change the username and password as well as the FTP server address before saving the changes with Ctrl+x and Y. Now every time our backup runs, it will FTP the files to the remote FTP server.


Next post:

Previous post: