Ça traînait. Ça avait l'air cool. J'ai gité.
This commit is contained in:
parent
cd4228b9ea
commit
6bace1cfbb
2 changed files with 48 additions and 0 deletions
37
BackupPC_GetTarBackup.sh
Executable file
37
BackupPC_GetTarBackup.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
# La syntaxe de BackupPC_tarCreate est un peu chiante... Ce wrapper facilite le travail pour extraire une sauvegarde
|
||||
# NS. 18 juin 2005
|
||||
|
||||
host=$1
|
||||
shareName=$2
|
||||
Destdir=$3
|
||||
AddPath=$4
|
||||
args=$#
|
||||
|
||||
CheckHost() {
|
||||
test -f /var/lib/backuppc/pc/$host/backups || { echo "No backups for host $host !" ; exit 1 ; }
|
||||
LastBackup=$(tail -1 /var/lib/backuppc/pc/$host/backups | cut -f 1)
|
||||
}
|
||||
|
||||
CheckDestDir() {
|
||||
if [ "$Destdir" != "" ] ; then
|
||||
test -d $Destdir || { echo "Destination directory not found !" ; exit 1 ; }
|
||||
Destdir="$Destdir/"
|
||||
fi
|
||||
}
|
||||
|
||||
Usage() {
|
||||
if [ $args -lt 2 ] ; then
|
||||
echo "Usage: $0 host shareName [Destdir] [AddPath]" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
Usage
|
||||
CheckHost
|
||||
CheckDestDir
|
||||
#echo Last backup for $1 is number $LastBackup
|
||||
|
||||
/bin/su backuppc -c "/usr/share/backuppc/bin/BackupPC_tarCreate -h $host -n $LastBackup -s $shareName -r / -p $AddPath/ . > ${Destdir}${host}.${shareName}.tar"
|
||||
|
11
utils/delete_ldap_log.sh
Executable file
11
utils/delete_ldap_log.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
# Petit script pour réduire la place prise par les anciens logs
|
||||
# de ldap qui ne sont plus utilisés
|
||||
|
||||
STORE=/var/lib/ldap
|
||||
|
||||
for f in `db4.8_archive -h $STORE`; do
|
||||
echo Removing $f ...
|
||||
rm -f $STORE/$f
|
||||
done
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue