> This backup script takes good care of the important things like
> /home/$user
> $user/document_folder(s)
> /etc #to get all the system config files in the event something
>      #terrible happens and I've got to reload and recover
... snip ...

Here's a simple backup script I wrote (found at bottom) to back
up the directories and files that I care about, if disaster ever
strikes. I put a copy of this in /etc/cron.daily to execute.

Thanks... Dan.

---------- mybackup.sh script below this line.
#!/bin/sh

backup='/scratch/backup'    # /scratch is a partition on disk 2
tar='tar cpzf'
ext='.tgz'
tmpfile='/root/tmp/b$$'

dirs='root etc boot
home/cvs home/dns home/dwoods home/httpd home/mysites home/sentry home/users
usr/local/bin usr/local/jdk usr/local/logcheck usr/local/netpbm
usr/local/portsentry usr/local/postfix usr/local/webalizer usr/local/whois
var/log var/lib/mysql var/lib/mysql/data var/spool
'

files='usr/bin/logcheck.sh sbin/bastille-ipchains sbin/bastille-netfilter
'

if [ ! -d $backup ] ; then
    mkdir -p $backup
fi

cd /
for i in $dirs ; do
    if [ -d $i ] ; then
        fix=`echo $i | tr '/' '_'`
        find $i -type d -o -type f -print | sort > $tmpfile
        $tar $backup/$fix$ext -T $tmpfile
        rm -f $tmpfile
    fi
done

cd /
for i in $files ; do
    if [ -d $i ] ; then
        fix=`echo $i | tr '/' '_'`
        cp -pf $i $backup/$fix$ext
    fi
done




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to