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}
|
BORGSCRIPTS=${borg_BORGSCRIPTS}
|
||||||
BORGLOG="${borg_BORGLOG}/BorgBackup-$(date +%d-%m-%Y-%H-%M-%S).log"
|
BORGLOG="${borg_BORGLOG}/BorgBackup-$(date +%d-%m-%Y-%H-%M-%S).log"
|
||||||
DEBUG=false
|
DEBUG=false
|
||||||
|
#Fichier des sauvegardes a supprimer
|
||||||
|
BORG_FIC_DEL=${borg_BORG_FIC_DEL}
|
||||||
|
|
||||||
#####################################################
|
#####################################################
|
||||||
#
|
#
|
||||||
@ -155,6 +157,7 @@ usage() {
|
|||||||
echo "-h : Usage"
|
echo "-h : Usage"
|
||||||
echo "-c : Permet de compacter ${BORG_REPO}"
|
echo "-c : Permet de compacter ${BORG_REPO}"
|
||||||
echo "-d : Permet de verifier les variables de sauvegarde"
|
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 "-i : Mode interractif"
|
||||||
echo "-info"
|
echo "-info"
|
||||||
echo "-l : Liste les sauvegardes sans monter ${BORG_REPO}"
|
echo "-l : Liste les sauvegardes sans monter ${BORG_REPO}"
|
||||||
@ -180,6 +183,18 @@ Borgvariables() {
|
|||||||
fi
|
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() {
|
Borgmount() {
|
||||||
LogFic "Montage du repo ${BORG_REPO} sur ${BORGMOUNT} .. "
|
LogFic "Montage du repo ${BORG_REPO} sur ${BORGMOUNT} .. "
|
||||||
echo -en "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
|
Borginfo
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
'-delbackup' )
|
||||||
|
shift
|
||||||
|
BorgDelBackups
|
||||||
|
exit
|
||||||
|
;;
|
||||||
* | ' ' )
|
* | ' ' )
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user