[ previous ] [ next ] [ threads ]
 
 From:  Andreas Ferrari <aferrari at stasoft dot ch>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] How Often Do You Backup Your m0n0wall Config?
 Date:  Thu, 17 Jan 2008 10:13:42 +0100
Daily with this Perl script...

#!/usr/bin/perl

#Script to for M0n0backups

use strict;

my %conf;

$conf{proto}="https";
$conf{user}="admin";
$conf{rm}="/bin/rm -rf";
$conf{mkdir}="/bin/mkdir";
$conf{curl}="/usr/bin/curl -k -s -o";
$conf{args}="-F Submit=download -u $conf{user}";
#in this dir are the Backups stored
$conf{base}="/var/www/m0n0bak";
$conf{conf}=
{
         CostumerN01=>{
                'm0n0.XXy.ch'=>'iporhostname:pass',
                'm0n02.XXy.ch'=>'iporhostname:pass',
         },
         CostumerN01=>{
                'm0n0.XXz.ch'=>'iporhostname:pass',
         },
};
#system("$conf{rm} $conf{base}");
#system("$conf{mkdir} $conf{base}");
chdir $conf{global}{base};
for(sort keys %{$conf{conf}}){
  my $costumer=$_;
        print " Doing backup for costumer:$costumer\n";
        system("/bin/mkdir $conf{base}/$costumer");
        chdir "$conf{base}/$costumer";
        for(sort keys %{$conf{conf}{$costumer}}){
          my $host=$_;
                my ($ip,$pw)=split /:/,$conf{conf}{$costumer}{$host};
                print "Donwloading config from host:$host\/ip:$ip\n";
                my $filename ="config-$host.xml";
                my $uri="$conf{proto}://$ip/diag_backup.php";
                system("$conf{curl} $filename $conf{args}:$pw $uri\n");
                print "Download of configfile $filename complete..\n";
        }
}

Maybe someone find it usefull...

Falcor schrieb:
> Lee Sharp wrote:
>
>> Aaron Cherman wrote:
>>
>>> Hey everyone, I hope this isn't considered spam to everyone.  I see 
>>> posts every so often of users who have a m0n0wall installation that 
>>> is not responding for various reasons and have a need to get there 
>>> config.xml due to the lack of a backup.  I am curious how often 
>>> everyone else backs up their configs.  I backup mine every time I 
>>> make a major change (ie. add/remove/change a filter rule, 
>>> add/remove/change a NAT mapping, etc.).  My backups could be a 
>>> couple times a day and sometime not for over a month.
>>
>>
>>
>> Hate to say it, but never.  And we have about 30 out there...  
>> Sigh... So far, only one major failure, and the lightning took out 
>> the APs as well, so everything had to be replaced.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
>> For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch
>>
> I liked the scropt that Chris Boot published.  Anyone know if you can 
> NFS mount from the m0n0wall?  If I could do that I could put nearly 
> endless backups on my NAS.
> Hopefully Chris' script or my recently published directions on 
> recovering your config will help some people.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: m0n0wall dash unsubscribe at lists dot m0n0 dot ch
> For additional commands, e-mail: m0n0wall dash help at lists dot m0n0 dot ch
>


-- 
STASOFT AG
P: +41 61 726 80 70
F: +41 61 726 80 79