[ previous ] [ next ] [ threads ]
 
 From:  monideth dot pen at unitednetworks dot co dot uk
 To:  Imre Ispanovits <iimre at vnet dot hu>
 Cc:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] Automated config.xml remote backup - solution
 Date:  Fri, 22 Oct 2004 11:59:23 +0100
Imre,

I suggest you change the script to moving the file to a archive directory 
(or just zip it up).

The reason for this is that if you manage to somehow get a bad config.xml 
file then you risc losing your (potentially only) good one! The other 
reason is that it makes it easier to roll back to a previous config - or 
check previous configurations.

However, there is also the issue of how many of these backup files to 
keep, which will mean your script will be a bit more complicated.

Regards,

Mon

Note: Please take note of our new office contact numbers.

====================================================================

Monideth Pen

IP Product Engineering Manager

Email:          monideth dot pen at unitednetworks dot co dot uk

Mobile:         +44 (0)7801 665563

--------------------------------------------------------------------

HQ                                       Switch Site

     United Networks Ltd.                     United Networks Ltd.
     Network House                            2nd Floor Challenger House
     15 High Street                           42 Adler Street
     Hampton Hill                             London E1 1EE
     Middlesex  TW12 1NB                      UK
     UK 

DDI: +44 (0)20 8635 5570                 DDI: +44 (0)20 7177 6023

Tel: +44 (0)20 8635 5555                 Tel: +44 (0)20 7177 6000
Fax: +44 (0)20 8635 5550                 Fax: +44 (0)20 7177 6060

http://www.unitednetworks.co.uk          http://www.veloxnet.com

--------------------------------------------------------------------

IM:             ICQ     - 53372490
                Yahoo!  - monideth at yahoo dot com
                MSN     - monideth at hotmail dot com

====================================================================






Imre Ispanovits <iimre at vnet dot hu>
22/10/2004 11:34
 
        To:     m0n0wall at lists dot m0n0 dot ch
        cc: 
        Subject:        Re: [m0n0wall] Automated config.xml remote backup 
- solution


On Thu, 21 Oct 2004 17:17:56 +0100
monideth dot pen at unitednetworks dot co dot uk wrote:

> I am using the following command:
> 
> wget --post-data 'Submit=Download' 
> https://<username>:<password>@<host_ip>/diag_backup.php -O  config.xml
>

Thanks Frederick,

It works fine me exactly the same way you wrote. (Debian / wget 1.9.x)
I have just copied over what you wrote and made some "version checking".
thanks for it
#############################
dir1="/var/backups/"
file1=`ls $dir1*_config.xml`
file2="m0n0_XXX_"`date +%Y%m%d%H%M`_config.xml
wget --post-data 'Submit=Download' 
https://username:secret@111.222.333.444/diag_backup.php -O  $dir1$file2
cd $dir1
cmp $file1 $file2
if [ "$?" = "0" ];
    then
    rm $file2
    else
    rm $file1
fi
#############################


regards

Imre Ispanovits

---------------------------------------------------------------------
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