ajout de suppression des sauvegardes
This commit is contained in:
parent
e46bde1969
commit
9f6fbd5d47
@ -53,6 +53,8 @@ NB_BACKUPS_MOIS=${borg_NB_BACKUPS_MOIS}
|
||||
BORGSCRIPTS=${borg_BORGSCRIPTS}
|
||||
BORGLOG="${borg_BORGLOG}/BorgBackup-$(date +%d-%m-%Y-%H-%M-%S).log"
|
||||
DEBUG=false
|
||||
#Fichier des sauvegardes a supprimer
|
||||
BORG_FIC_DEL=${borg_BORG_FIC_DEL}
|
||||
|
||||
#####################################################
|
||||
#
|
||||
@ -155,6 +157,7 @@ usage() {
|
||||
echo "-h : Usage"
|
||||
echo "-c : Permet de compacter ${BORG_REPO}"
|
||||
echo "-d : Permet de verifier les variables de sauvegarde"
|
||||
echo "-delbackup : Permet la suppression de backups renseignés dans un fichier ${BORG_FIC_DEL} "
|
||||
echo "-i : Mode interractif"
|
||||
echo "-info"
|
||||
echo "-l : Liste les sauvegardes sans monter ${BORG_REPO}"
|
||||
@ -180,6 +183,18 @@ Borgvariables() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
BorgDelBackups() {
|
||||
|
||||
[ -z ${BORG_FIC_DEL} ] && { echo "Le fichier n'est pas renseigné" ; exit 1; }
|
||||
[ ! -r ${BORG_FIC_DEL} ] && { echo "Le fichier ${BORG_FIC_DEL} est inexistant" ; exit 1 ; }
|
||||
for Backups in $(cat ${BORG_FIC_DEL})
|
||||
do
|
||||
echo "suppression de la sauvegarde ${Backups}"
|
||||
borg delete ${BORG_REPO}::${Backups}
|
||||
done
|
||||
}
|
||||
|
||||
Borgmount() {
|
||||
LogFic "Montage du repo ${BORG_REPO} sur ${BORGMOUNT} .. "
|
||||
echo -en "Montage du repo ${BORG_REPO} sur ${BORGMOUNT} .. "
|
||||
@ -389,6 +404,11 @@ for ARG in $@; do
|
||||
Borginfo
|
||||
exit
|
||||
;;
|
||||
'-delbackup' )
|
||||
shift
|
||||
BorgDelBackups
|
||||
exit
|
||||
;;
|
||||
* | ' ' )
|
||||
usage
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user