Sorry, my listing file looks like this...
local.import 1 /local/import
local.backup 1 /local/backup
local.bin 1 /local/bin
etc 1 /etc
etc.mail 1 /etc/mail
etc.httpd.conf 1 /etc/httpd/conf
home.httpd.cgi-bin 2 /home/httpd/cgi-bin
etc.sysconfig.network-scripts 1 /etc/sysconfig/network-scripts
etc.sysconfig 1 /etc/sysconfig

-----Original Message-----
From: George Vieira [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 30, 2000 12:00 PM
To: '[EMAIL PROTECTED]'
Subject: [SLUG] configuration backup to floppy


Hi all,

Since we're in the scripting mood...Ok, Ok... maybe some. I have created a
script which basically reads a file in a backs each directory and depth
listed in the file.
I am currently using the find and pipe to cpio to /mnt/floppy but would like
to now change this to just the files and in it's directory structue so:

/home/georgev will copy into /mnt/floppy/home/georgev
/etc/sysconfig will copy into /mnt/floppy/etc/sysconfig  <- but only it's
file contents unless specified in the file list

Here is my current (badly written) script which is the cpio version if
anybody would like to help me write it as I'm having troubles creating the
copy and the structure....

#!/bin/bash

BASE="\033[36m`/bin/basename $0`\033[00m"
PTH=$PWD

echo -e "$BASE: Attempting to mount floppy disk"
mount /dev/fd0 /mnt/floppy -t vfat >/dev/null 2>&1

STATUS=$!

if [ "$STATUS" = "1" ]
then
        echo -e "$BASE: Already mounted or mount error $STATUS"
        exit 1
else
        echo -e "$BASE: Mounted OK"
fi

>/local/bin/confbackup.log
while read EXT DEPTH FILES
do
        echo "Backing up $FILES with maximum depth of $DEPTH"
        cd $FILES
        find . -maxdepth $DEPTH -type f -print | cpio -ocvLB -O
/mnt/floppy/backup.$EXT 2>/local/bin/confbackup.log.$EXT 
done < /local/bin/confbackup.files

cd $PTH
echo -e "$BASE: Unmounting Floppy Disk"
umount /mnt/floppy


thanks,
George Vieira
Network Administrator
http://www.citadelcomputer.com.au
PGP Fingerprint :       43DC 92AC 1A82 27B2 E97B  52F1 B60F 301A 38A9 A10C
PGP KeyID:              0x38A9A10C



--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug


--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to