Asterisk Server Backup & Restore


I am almost getting ready with my new Asterisk Server. I am looking for some information on how to backup & restore asterisk server. I have RAID 5 with 3 HDD drives. Please let me know some opensource based backup utility.


the main thing to back up is /etc/asterisk/* and /etc/zaptel.conf. Also your mysql tables if you use them.

Hi IronHelix,

Is there a easy command to zip the entire folder and ftp the same? I am looking for a complete solution like Veritas. Is there anything for Linux?


the asterisk backup that A@H / TrixBox is a good file to start with. customise it with locations, then you can ftp/scp it off, or even mount a share elsewhere on the network and dump it there for tape backup later.

no need to buy software for this, shell scripting will do the majority for you.

compress /etc and e-mail it in cron
tar -zcvf hostname.tar.bz2 /etc (as root for permissions sake)
mime-construct (i don’t remember whole shwitches but You can add file attachment)

Hi fdragowski,

Thanks for your reply. Can you please give me more details or redirect me to some reading material to write cron job to email the ZIP file? i wrote something like this in windows but not in linux.


Hi baconbuttie,

For some reason, i never was able to fix the incoming calls issue with Trixbox., I know that you offered some help on that, but i was not able to get that system up. I will request you again after fixing my trixbox server issue.


IronHelix wrote:

the main thing to back up is /etc/asterisk/* and /etc/zaptel.conf.
Also your mysql tables if you use them.

Also /var/lib/asterisk/sounds if you’ve made up any custom audio prompts or messages.

Also /var/spool/asterisk/voicemail if you have any received voicemails or “busy” or “unavailable” outgoing messages you want to save.

Perhaps other stuff in /var/lib/asterisk and /var/spool/asterisk, too.

I back up /etc, and any other directory tree that’s named “asterisk”. :smile:

man crontab -S5
mam mime-construct should exist (i don’t have it on my desktop pc, here You will find html manual
to send mails You will need mailer-daemon exim, postfix or something else
for backuping sounds, voicemails messages, saved calls (monitor) You can consider backuping on DVD
bzip all You need then run growisofs (dvd+rw-tools) all will be burned on DVD (all in cron job)


This is what I backup its then ftp’d to a remote server. Customer systems are also backed up the same and ftp’d to a central server.

The file is 34Meg but its all I need to rebuild the system.


Thanks to Everyone,

I like the options FTP & DVD Burning. I will try FTP Option tomorrow. Can i make this process automated with date option included to backupDATE.tar.gz? I need to learn more to use the DVD buring tools etc. Thanks ianplain & IronHelix.


tar -zcvf date +%Y-%m-%d-%H:%M.hostname.tar.bz2 /etc
will compress /etc and filename would be for example 2006-08-11-09:08.MtG.tar.bz2
install dvd+rw-tools
read man growisofs

Thanks a lot fdragowski,

This is perfectly working for me. I am reading cron jobs related stuff. soon, i hope i will get a script to export this backup file to my FTP Server.

Thanks a lot for everyone.