Additional files you might want to backup with the ampbackup.pl script

Ok we’ve customized our setup a bit but not much (running trixbox 2.2.4 with freepbx 2.3.0).

When you use the phone system all day and the only time for upgrades are late at night when you are in need of sleep you end up being not at 100% some times doing a upgrade. This can cause issues with things being over written without you thinking ahead of time to save things.

So here is a list of things we’ve added the ampbackup.pl file to be backed up. (line 165).

/etc/zaptel.conf* /tftpboot $webroot/panel /etc/hosts /etc/resolv.conf /etc/logrotate.d/asterisk

/etc/zaptel.conf* files because we have a T1 card and analog card. They of course don’t work if I switch the order as I’ve had to hand edit adjustments to make things work correctly from the genzaptelconf. (has to do with order of things).

/tftpboot Well we have 45 Aastra phones that boot via tftp so if the system goes away we are screwed if I have to re-create all those files again at 3am (25% of which are not in the local office but remote via VPN tunnels).

$webroot/panel since we have more then 40 phones I’ve had to re-adjust the panel config files and layout so I have three columns for extensions and enough space for our 26 trunks (I also have to customize 4 lines in the /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl file to this support).

/etc/resolv.conf yea I’m just lazy I have our three name servers and 6 domains defined in it so I don’t need to recreate that also.

/etc/hosts Same lazy reason as we have three servers that MUST be defined in the hosts file for our backup software to work.

If people have to have routes defined and/or special settings for the NIC you might want to backup the /etc/sysconfig/network-scripts/route-* and /etc/sysconfig/network-scripts/ifcfg-* files.

/etc/logrotate.d/asterisk I’ve added the “/var/log/asterisk/full” to the log rotation so it doesn’t grow out of control.

Thanks,

these would be best posted on a feature request ticket against the Backup Module in the bug tracker so that they don’t get lost in the forum. Feel free to open up such a ticket and put them there. (Given that Backup is in dire need of attention …)

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

fyi: there is not a clear link on the main website to the bug tracking system…

In the Left Navigation Bar: Development site and the fly-out menu provides yet more. Do you have suggestions to improve that?

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

I’m just a bit confused as some is across the top in the tabs and more on the left nav bar. I’m so used to looking at the tabs only when I see tabs. I’ll learn…

We are still trying to fine tune the what goes where so that it is not so hard to find things. My theory (being discussed with different opinions) is that everything should be on the left and then the top tabs would be some of the more common tabs that one finds on websites in general.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

Here is my backup script I think this effectively grabs what I need.

##CUT GNU HEADER FOR BREVITY...
##backup.sh##

## THIS FILE SHOULD BE COPIED AS A FILE TO YOUR ASTERISK SYSTEM WINDOWS TEXT EDITORS AND 
## LINUX/UNIX TEXT EDITORS MAY NOT BE COMPATIBLE. THIS SCRIPT ASSUMES CERTAIN FORMATING.
## THIS SHOULD BE THE ONLY THING THAT HAS TO CHANGE AND SHOULD MATCH YOUR AMPORTAL.CONF ##
############################
DB_USER=asteriskuser
DB_PASS=amp109
############################

mkdir -p /var/backups
mysqldump -u $DB_USER -p$DB_PASS --all-databases > /var/backups/backup.sql &&
cd /
tar pzcvf restore-`date --iso-8601`.tgz \
/etc/asterisk \
/etc/zaptel.conf \
/etc/amportal.conf \
/var/spool/asterisk/ \
/root/ \
/var/backups/backup.sql

exit 0;

I see several things that from our point we’d have issues with not being backed up.

you don’t have any /var/www/html/admin/* (also knowns as $webroot/admin) so you can’t restore freepbx, any customizations that you might have done, and now they are moving the config files into this area so backing it up is important.

/var/www/html/panel if you use and have tweaked the panel

Depending on how you tweak the panel you’ll end up editing the /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl. If you use the fax stuff and hate the %xx codes in the subject lines I posted a patch to remove those properly which tweaks the fax-process.pl script in the same directory.

See my initial post at the top and why I said you might want them backed up. Then look at your setup and needs and determine if you want to risk not having something backed up. Creating the backup but leaving it on the same system is a BIG simple mistake many make. We have a secondary backup process that backs the system up to tape/second drive on another system so if it blows up we can recover.

Everybody will have there own needs, I was pointing out things I thought could be added to be more complete…

I have another script that does all of that the above backs up settings and voicemail to be copied into a new intall…

you can always add:

/path/ \

to the above and backup any file on the system you want to take with…

there is a restore file that goes with this BTW

We actually have a full network backup that runs at night. It does everything minus a few things we exclude. It’s just a pain to do restores but has saved up several times. That’s why I tweaked the backup so that the nightly tarball has more of what is needed and one day I can stop doing network backup except for the tarball when it is done.

If using g729:

Per the [Backup Procedure] section in Digium’s G729 README:

http://downloads.digium.com/pub/telephony/codec_g729/README

should backup /var/lib/asterisk/licenses .

Edit ampbackup.pl to include:

“.$ast{‘astvarlibdir’}.”/licenses/

i.e.:

system ("/bin/tar -Pcz -f /tmp/ampbackups.$Stamp/configurations.tar.gz “.$ast{‘astvarlibdir’}.”/agi-bin/ “.$ast{‘astvarlibdir’}.”/bin/ “.$ast{‘astvarlibdir’}.”/licenses/ /etc/asterisk $webroot/admin /etc/amportal.conf /tmp/ampbackups.$Stamp/astdb.dump ");

Cheers