[ previous ] [ next ] [ threads ]
 
 From:  Jim Gifford <jim at giffords dot net>
 To:  m0n0wall at lists dot m0n0 dot ch
 Subject:  Re: [m0n0wall] getting config.xml
 Date:  Fri, 9 Apr 2004 11:59:18 -0400
On Fri, Apr 09, 2004 at 05:09:35PM +0200, fisch wrote:
> hi,
> I want to include the m0n0wall-config into my backup. Is there a way to
> get the config.xml remotely?
> bye
> fisch
> -- 
> fisch at conne dash island dot de
> http://kampagne.conne-island.de

I use the attached script, named 'm0n0back' on my system, from cron each
hour to back up my config.xml into CVS.  My CVS repository is backed up
every 4 hours as part of my regular backups using rsnapshot
(http://www.rsnapshot.org/).  This gives me the ability to roll back
changes as needed to any point in the past.

hope this helps,
jim

PS, this should be in the archives from the first time I posted it.
*grin*
#!/bin/sh

CVSROOT=/data/cvs
export CVSROOT
CVSPROJ=backup
M0N0IP=192.168.1.1
PROTO=http
USER=admin
PASS=XXXXXXXX
TMPDIR=/tmp/$$

mkdir $TMPDIR
cd $TMPDIR

cvs -Q co $CVSPROJ
cd $CVSPROJ

curl -s -o config.xml -F Submit=download -u ${USER}:${PASS} ${PROTO}://$M0N0IP/diag_backup.php

NOW=`date +%Y-%m-%d@%H:%M:%S`
cvs -Q commit -m "$NOW backup"

cd /tmp
rm -rf $TMPDIR