Hi gang, 

             I see that some posters today don't do full (or any?) backups
of their Asterisk systems/configuration.  This may (sort of) help you.
Since pretty much all Linux systems have some sort of PERL installed, these
two files will let you make a quick copy of any configuration or other file
you might be about to change or destroy.

 

File 1 - /usr/bin/checkout

/usr/local/bin/perl /etc/asterisk/checkout.pl $1

 

File 2 - /etc/asterisk/checkout.pl

#!/usr/local/bin/perl

# Author: Danny Nicholas

use File::Copy;

 

# assign command line parms

my $inname = $ARGV[0];

my ($sec, $min, $hr, $day, $mon, $year) = localtime(time);

$mon = $mon +1;

$mon = sprintf("%2d",$mon);

$day = sprintf("%2d",$day);

$hr = sprintf("%2d",$hr);

$min = sprintf("%2d",$min);

$mon =~ s/\s/0/;

$day =~ s/\s/0/;

$hr =~ s/\s/0/;

$min =~ s/\s/0/;

my $outname = $inname."_".$mon.$day."_".$hr.$min;

print "copy $inname to $outname\n";

copy($inname,$outname);

exit

 

If you are going to make a dialplan change, just do 

Checkout /etc/asterisk/extensions.conf and voila, you have a backup to fall
back on.

 

Hope this helps somebody.

 

Regards, 

Danny Nicholas

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to