scripts/backup.sh
pauget b82644de83 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
2003-10-02 00:28:47 +02:00

23 lines
589 B
Bash
Executable file

#!/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