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
This commit is contained in:
parent
1da7f5f638
commit
b82644de83
1 changed files with 23 additions and 0 deletions
23
backup.sh
Executable file
23
backup.sh
Executable file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue