672 |
richard |
1 |
#!/bin/bash
|
64 |
franck |
2 |
# $Id: alcasar-mondo.sh 672 2011-07-08 15:34:22Z richard $
|
518 |
stephane |
3 |
|
672 |
richard |
4 |
# alcasar-mondo.sh
|
|
|
5 |
# by Franck BOUIJOUX and Michel GAUDET
|
|
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
|
|
7 |
|
|
|
8 |
# Création de l'archive à chaud du système
|
|
|
9 |
# Hot system backup creation
|
|
|
10 |
|
1 |
root |
11 |
DIR_TMP="/var/log/mondo"
|
|
|
12 |
DIR_ISO="/var/Save/ISO"
|
|
|
13 |
date=`date +%F-%Hh%M`
|
|
|
14 |
HOSTNAME=`hostname -s`
|
|
|
15 |
ROOT="root"
|
|
|
16 |
ISOFile=$HOSTNAME-$date
|
|
|
17 |
EXCLUDE="$DIR_ISO $DIR_TMP /tmp /mnt /media"
|
|
|
18 |
|
|
|
19 |
echo "Les répertoires exclus de l'image ISO sont : $EXCLUDE "
|
|
|
20 |
echo "##################################################"
|
|
|
21 |
echo "# Création de l'archive ISO système d'Alcasar ! #"
|
|
|
22 |
echo "##################################################"
|
|
|
23 |
echo ""
|
|
|
24 |
echo "--------------------------------------------------------"
|
|
|
25 |
echo "Les ISOs seront disponibles dans le répertoire suivant :"
|
|
|
26 |
echo "==--> $DIR_ISO"
|
|
|
27 |
/bin/touch $DIR_ISO/creation-of-the-current-archive
|
|
|
28 |
mkdir $DIR_TMP
|
|
|
29 |
/bin/nice -n 19 /usr/sbin/mondoarchive -p $ISOFile -Oi -s 4300m -d $DIR_ISO -T $DIR_TMP -S $DIR_TMP -E "$EXCLUDE"
|
645 |
franck |
30 |
|
1 |
root |
31 |
cd $DIR_ISO
|
645 |
franck |
32 |
for i in `ls $ISOFile*.iso` ;do
|
|
|
33 |
/usr/bin/md5sum $i.iso > $i.iso.md5
|
1 |
root |
34 |
done
|
645 |
franck |
35 |
chown apache $DIR_TMP/mondo.scratch.* $DIR_TMP/tmp.mondo.* $DIR_TMP/.*.dat $DIR_ISO/creation-of-the-current-archive
|
1 |
root |
36 |
rm -rf $DIR_TMP/mondo.scratch.* $DIR_TMP/tmp.mondo.* $DIR_TMP/.*.dat
|
|
|
37 |
rm -f $DIR_ISO/creation-of-the-current-archive
|
645 |
franck |
38 |
|
1 |
root |
39 |
exit 0
|