Autant avoir un backup de nos fablab, car une bonne sauvegarde c'est toujours utile hors-site

Sauvegarde fablab





Sauvegarde Tuxfamily


backup_baud_tf.sh
#! /bin/bash
#

vDate=`date +%F`
vLogFile=`pwd`/log_backup_baud.log

mkdir data_${vDate} ; cd data_${vDate}

echo "=== ${vDate} ===" >> ${vLogFile}
date >> ${vLogFile}

for vProject in adminlibre  cauldron  demoll kerarmorbzh linuxgraphic mandrivafr openarena  vhffs4 assocetf cooker eagleusb librehwdb magnum nekeme tfcontrib
do
    echo ${vProject} >> ${vLogFile}
    scp baud123@ssh.tuxfamily.org:/home/${vProject}/${vProject}_*.dump . 2>> ${vLogFile}
done

date >> ${vLogFile}

# exit

for vProject in sunlab linuxfr urbarchie
do
    echo ${vProject} >> ${vLogFile}
    scp baud@ssh.tuxfamily.org:/home/${vProject}/${vProject}_*.dump . 2>> ${vLogFile}
done

date >> ${vLogFile}

# compresse les dumps...
#

cd ..
tar Ycvf tar_dump_${vDate}.tar.lzma data_${vDate}/* 2>> ${vLogFile}

date >> ${vLogFile}

exit

# efface les repertoires de plus de 30 jours
find . -name "data*" -type d -mtime +30 | while read vDataDir
do
    /bin/rm -Rf ${vDataDir}
done

# efface les fichiers tar de plus de 120 jours (environ 4 mois)


find . -name "tar*" -type f -mtime +120 | while read vTarFile
do
    /bin/rm -f ${vTarFile}
done
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki