This is a quick shell script I wrote that allows me to grab backups off of my Asterisk servers and drop them on whatever system I happen to run the script from. In this case, I wrote it for my laptop so I could quickly grab a full asterisk and mysql backup or just the entire /etc/asterisk directory from Asterisk servers I was running.

I am quite sure there are better ways to do this script – maybe someone could post them here. As usual – Use this script at your own risk.

Cheers

One thing that I have noted is that WordPress rewrites some of the stuff when I paste my scripts, so for the actual real script, please click here: SCRIPT

#!/bin/bash
#######################################################
# grab_backups v1 – Richard J. Sears 4/23/06
# Simple script to grab some Asterisk backups from other
# systems
#######################################################

#Set some varables up

ASTERISKDIR=’/etc/asterisk/’
CAT=’/bin/cat’
SCP=’/usr/bin/scp’
ECHO=’/bin/echo’
SAVETODIR=’/backups’
BASEDIR=’/root’
EXTERNALSERVERDIR=’/root/backups/backups_from_other_machines/’
ALL=’/root/servers’
CUT=’/usr/bin/cut’
REMOTEBACKUPDIR=’/backups/’

help()
{
cat <