Subversion Repositories ALCASAR

Rev

Rev 672 | Blame | Last modification | View Log

#!/bin/bash
# $Id: alcasar-mondo.sh 749 2011-10-20 16:49:59Z franck $

# alcasar-mondo.sh
# by Franck BOUIJOUX and Michel GAUDET
# This script is distributed under the Gnu General Public License (GPL)

# Création de l'archive à chaud du système
# Hot system backup creation

DIR_TMP="/var/log/mondo"
DIR_ISO="/var/Save/ISO"
date=`date +%F-%Hh%M`
HOSTNAME=`hostname -s`
ROOT="root"
ISOFile=$HOSTNAME-$date
EXCLUDE="$DIR_ISO $DIR_TMP /tmp /mnt /media" 

echo "Les répertoires exclus de l'image ISO sont :  $EXCLUDE "
echo "##################################################"
echo "# Création de l'archive ISO système d'Alcasar  ! #"
echo "##################################################"
echo ""
echo "--------------------------------------------------------"
echo "Les ISOs seront disponibles dans le répertoire suivant :"
echo "==-->   $DIR_ISO"
/bin/touch $DIR_ISO/creation-of-the-current-archive
mkdir -p $DIR_TMP
/bin/nice -n 19 /usr/sbin/mondoarchive -p $ISOFile -Oi -s 4300m -d $DIR_ISO -T $DIR_TMP -S $DIR_TMP -E "$EXCLUDE"

cd $DIR_ISO
for i in `ls $ISOFile*.iso` ;do
        /usr/bin/md5sum $i.iso > $i.iso.md5
done
chown apache $DIR_TMP/mondo.scratch.* $DIR_TMP/tmp.mondo.* $DIR_TMP/.*.dat $DIR_ISO/creation-of-the-current-archive
rm -rf $DIR_TMP/mondo.scratch.* $DIR_TMP/tmp.mondo.* $DIR_TMP/.*.dat
rm -f $DIR_ISO/creation-of-the-current-archive

exit 0