From 83aa97009d54bbd7f5e1cbc8bbd4596b9d877941 Mon Sep 17 00:00:00 2001 From: sayan Date: Mon, 24 Nov 2003 17:34:05 +0100 Subject: [PATCH] ajout synchro des news et des homes. La synchro des homes est dfectueuse, et choue sur les rpertoires auquel root@zamok peut accder mais pas backupcrans@tanek. Le script ne devrait pas chouer, mais la restauration ne pourra pas tre complte. -- Sayan darcs-hash:20031124163405-d1356-a1004241032455ed9d4ed704185d802795c0e805.gz --- backup.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/backup.sh b/backup.sh index f165349a..af285702 100755 --- a/backup.sh +++ b/backup.sh @@ -4,6 +4,7 @@ ## Sayan 02/10/2003 ## Ajout de la synchro du site web : Sayan 04/10/2003 ## Ajout de la synchro des mails : Sayan 19/10/2003 +## Ajout de la synchro des news et des homes : Sayan 15/11/2003 ## Nom de fichiers et chemins temp_dir=$(mktemp -d) @@ -11,35 +12,38 @@ nom_archive=$temp_dir"/backup_"$(hostname)"_"$(date --iso-8601)".tar.bz2" nom_selections=$temp_dir"/selections" ## Que sauvegarder ? -confs="etc usr/cvs-rep CRANS usr/scripts boot/config*" # via tar bzip2 -site_web="home/httpd/CVS-Repository" # via rsync -mails="var/spool/mail" +# via tar bzip2 +confs="etc usr/cvs-rep CRANS usr/scripts boot/config*" +# via rsync +site_web="/home/httpd/CVS-Repository" +mails="/var/spool/mail" +news="/var/spool/news" +homes="/home" cd / # tgz le contenu des répertoires # ajoute dpkg --get-selections +# echo Preparing to backup configs... dpkg --get-selections > $nom_selections || exit 1 tar -cjf $nom_archive $confs .$nom_selections || exit 2 - -# scp le fichier sur tanek +# echo Sending configs to tanek... scp $nom_archive backupcrans@tanek: || exit 3 -# rsync over ssh pour le site web +# rsync over ssh pour le site web, les homes, les mails et les news # archive, compress, sparse, hard links, CVS exclude, remote shell +# archive is rlptgoD : recursive, symlinks, perms, times, group, owner, Devices # suppr les fichiers non existant sur zamok # synchro journalière, switch par semaine week=$(date +%W) # numéro de la semaine week_mod2=$(( $week % 2 )) -rsync -azSHCe ssh --delete $site_web backupcrans@tanek:~/httpd-$week_mod2 || exit 4 -# rsync over ssh pour les mails -# archive, compress, sparse, hard links, CVS exclude, remote shell -# suppr les fichiers non existant sur zamok -# synchro journalière, switch par semaine -week=$(date +%W) # numéro de la semaine -week_mod2=$(( $week % 2 )) -rsync -azSHCe ssh --delete $mails backupcrans@tanek:/mnt/backup$week_mod2/var/spool || exit 5 +rsync -azSHe ssh --delete $site_web backupcrans@tanek:~/httpd-$week_mod2 || exit 4 +rsync -azSHe ssh --delete $mails backupcrans@tanek:/mnt/backup$week_mod2/var/spool || exit 5 +rsync -azSHe ssh --delete $news backupcrans@tanek:/mnt/backup$week_mod2/var/spool || exit 6 +# Les homes sont donnés à backupcrans.backup sans les permissions +# Tanek peut alors écrire tous les fichiers, mais restauration non exacte +rsync -azSHe ssh --delete $homes backupcrans@tanek:/mnt/backup$week_mod2 || exit 0 # clean