From b82644de83fe2cddc2bcba8ca34a9d9991be7304 Mon Sep 17 00:00:00 2001 From: pauget Date: Thu, 2 Oct 2003 00:28:47 +0200 Subject: [PATCH] Systme de sauvegarde des fichiers de conf : /etc /usr/cvs-rep /CRANS /usr/scripts /boot/config et dpkg --get-selections -- Sayan via Fred darcs-hash:20031001222847-41617-0f900c8e193f4007d40c88084a6e693174af00b0.gz --- backup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 backup.sh diff --git a/backup.sh b/backup.sh new file mode 100755 index 00000000..4e39b1d8 --- /dev/null +++ b/backup.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +## Sauvegarde des fichiers de conf sur Tanek +## Sayan 02/10/2003 + +## Nom de fichiers et chemins +temp_dir=$(mktemp -d) +nom_archive=$temp_dir"/backup_"$(hostname)"_"$(date --iso-8601)".tar.bz2" +nom_selections=$temp_dir"/selections" + +## Que sauvegarder ? +rep="/etc /usr/cvs-rep /CRANS /usr/scripts /boot/config*" + +# tgz le contenu des répertoires +# ajoute dpkg --get-selections +dpkg --get-selections > $nom_selections || exit 1 +tar -cjf $nom_archive $rep $nom_selections || exit 2 + +# scp le fichier sur tanek +scp $nom_archive backupcrans@tanek: || exit 3 + +# clean +rm -rf $temp_dir