Hallo Benjamin,
Benjamin Albrecht wrote on Sam, 24 Mär 2001 about hp streamer/
datensicherung
wie und was sollte man sichern. das ich meine daten sichere ist klar.
aber was ist mit dem system?
Ich sichere immer das komplette System, mit bestimmten Ausnahmen wie
/tmp, /proc ...
hat jemand scripte die man als cronjob laufen lassen kann?
Klar, hier ist mein Script, natürlich genau zu studieren und
anzupassen:
#!/bin/sh
#
# file: /etc/cron.scripts/tar-complete-backup
#
# This script is executed as a cron-job every day to backup
# all hd partitions.
#
# Author: Marcus Roeckrath , 1999-2000
#
# - make log file name and label out of hostname and current date
# - tar output goes to log file (which gets gzipped after end of backup)
# - some output on stdout like begin/end times and differences found in
# verify (cron will mail that to you)
# - invoke tar with non-std blocking-factor, verify mode, etc.
#
#
TOPDIR="/"
SDEV=/dev/st0
CDEV=/dev/st0
BLKFCT=512
LOGDIR="/var/log"
HOST=`hostname`
DTE=`date +%d.%m.%Y`
TME=`date +%H:%M:%S`
LBL="BACKUP-$DTE-$TME-b_$BLKFCT"
LOG="$LOGDIR/$LBL.log"
echo "" | tee -a $LOG
echo "Streamer Complete Backup" | tee -a $LOG
echo "" | tee -a $LOG
if mt --file=$SDEV rewind ; then
echo "$DTE-$TME Streamer ready"
echo ""
else
rm $LOG
echo ""
echo "$DTE-$TME No tape in streamer!"
echo "$DTE-$TME Backup aborted!"
if [ `date +%w` = "1" ] || [ `date +%w` = "4" ] ; then
echo ""
echo "$DTE-$TME Start Backup to HD now"
echo ""
/etc/cron.scripts/tar-complete-backup.hd
fi
echo ""
exit 1
fi
echo "$DTE-$TME Begin Backup of $HOST to $SDEV" | tee -a $LOG
echo "$DTE-$TME Logging to $HOST:$LOG" | tee -a $LOG
echo "$DTE-$TME Tapelabel $LBL" | tee -a $LOG
echo -n "$DTE-$TME Hardware-Compression: " | tee -a $LOG
if (mt -f /dev/st0 status | grep "Density code 0x25") ; then
mt --file=$SDEV datcompression 0 | tee -a $LOG
else
mt --file=$SDEV datcompression 2 | tee -a $LOG
fi
echo "" | tee -a $LOG
echo "Excluded files/dirs: /cdrom/* /cdwriter/* /floppy/* /floppyB/*" | tee -a $LOG
echo "Excluded files/dirs: /proc/* /tmp/* /mnt/* /hda7/*" | tee -a $LOG
echo "Excluded files/dirs: /home/marcus/Sound/Wave/*" | tee -a $LOG
echo "Excluded files/dirs: /home/marcus/CD-Images/*wav" | tee -a $LOG
echo "Excluded files/dirs: /home/marcus/CD-Images/*raw" | tee -a $LOG
echo "Excluded files/dirs: $LOG" | tee -a $LOG
echo "Excluded files/dirs: /dosC/windows/win386.swp" | tee -a $LOG
echo "" | tee -a $LOG
cd $TOPDIR
tar -cvvf $SDEV $TOPDIR -b $BLKFCT --exclude='/cdrom*' --exclude='/cdwriter*' --exclude='/floppy*' --exclude='/floppyB*' --exclude='/proc*' --exclude='/tmp*' --exclude='/mnt*' --exclude='/hda7*' --exclude='/home/marcus/Sound/Wave*' --exclude='/home/marcus/CD-Images/*wav' --exclude='/home/marcus/CD-Images/*raw' --exclude=$LOG --exclude=/dosC/windows/win386.swp --label="$LBL" --totals >>$LOG 2>&1
DTE=`date +%d.%m.%Y`
TME=`date +%H:%M:%S`
echo `grep "written: " $LOG`
echo "" | tee -a $LOG
echo "$DTE-$TME End Backup of $HOST to $SDEV" | tee -a $LOG
echo "" | tee -a $LOG
sleep 15
DTE=`date +%d.%m.%Y`
TME=`date +%H:%M:%S`
echo "$DTE-$TME Begin Comparing Backup of $HOST to $CDEV" | tee -a $LOG
echo "" | tee -a $LOG
tar -dvvf $CDEV -b $BLKFCT --totals >>$LOG 2>&1
echo "" | tee -a $LOG
DTE=`date +%d.%m.%Y`
TME=`date +%H:%M:%S`
echo "$DTE-$TME End Comparing Backup of $HOST to $CDEV" | tee -a $LOG
echo "" | tee -a $LOG
sleep 15
mt --file=$CDEV rewoffl
echo "$DTE-$TME Last lines of $LOG:"
tail --lines=10 $LOG
echo ""
echo "$DTE-$TME Problems found in $LOG:"
grep " differ" $LOG
grep " not exist" $LOG
grep "tar:" $LOG
echo ""
echo "$DTE-$TME Gzipping $LOG ..."
gzip $LOG
DTE=`date +%d.%m.%Y`
TME=`date +%H:%M:%S`
echo ""
echo "$DTE-$TME Finished processing"
echo ""
vielen dank im vorraus für die hilfe.
MFG
Benny
---------------------------------------------------------------------
To unsubscribe, e-mail: suse-linux-unsubscribe@suse.com
For additional commands, e-mail: suse-linux-help@suse.com
--
Gruss Marcus
Marcus Roeckrath -- Vikarsbusch 8 -- D-48308 Senden -- Germany
Phone : +49-2536-9944 -- Mailer/BBS/Fax : +49-2536-9943 (V34, X75)
FidoNet: 2:2449/523
E-Mail : marcus.roeckrath@gmx.de
WWW : http://home.foni.net/~marcusroeckrath/