correction des purge
This commit is contained in:
parent
06fe194dcc
commit
56f0021635
@ -21,7 +21,7 @@ setKazVars
|
||||
. $DOCKERS_ENV
|
||||
. $KAZ_ROOT/secret/SetAllPass.sh
|
||||
|
||||
VERSION="V-13-10-2024"
|
||||
VERSION="V-3-11-2024"
|
||||
PRG=$(basename $0)
|
||||
RACINE=$(echo $PRG | awk '{print $1}')
|
||||
#IFS=' '
|
||||
@ -140,10 +140,17 @@ Sauvegarde() {
|
||||
}
|
||||
|
||||
Purge() {
|
||||
borg prune --keep-daily=${NB_BACKUPS_JOUR} --keep-weekly=${NB_BACKUPS_SEM} --keep-monthly=${NB_BACKUPS_MOIS}
|
||||
if [ ! -z ${BACKUPS_KEEP} ]
|
||||
then
|
||||
borg prune --keep-within=${BACKUPS_KEEP}
|
||||
PRUNE_EXIT=$?
|
||||
else
|
||||
borg prune --keep-daily ${NB_BACKUPS_JOUR} --keep-weekly ${NB_BACKUPS_SEM} --keep-monthly ${NB_BACKUPS_MOIS}
|
||||
PRUNE_EXIT=$?
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Compact() {
|
||||
|
||||
borg compact --progress ${BORG_REPO}
|
||||
@ -160,7 +167,7 @@ echo "-i : Mode interractif"
|
||||
echo "-info"
|
||||
echo "-l : Liste les sauvegardes sans monter ${BORG_REPO}"
|
||||
echo "-m : Monte le REPO (${BORG_REPO} sur ${BORGMOUNT})"
|
||||
echo "-p : Permet de lancer la phase de purge des backup en fonctions des variables: jour=${NB_BACKUPS_JOUR},semaine=${NB_BACKUPS_SEM},mois=${NB_BACKUPS_MOIS}"
|
||||
echo "-p : Permet de lancer la phase de purge des backups"
|
||||
echo "-s : Lance la sauvegarde"
|
||||
echo "-u : Demonte le REPO (${BORG_REPO} de ${BORGMOUNT})"
|
||||
echo "-v : Version"
|
||||
@ -419,10 +426,16 @@ for ARG in $@; do
|
||||
;;
|
||||
'-p' )
|
||||
shift
|
||||
read -p "Ok pour lancer la purge en fonction de ces valeurs : jour=${NB_BACKUPS_JOUR},semaine=${NB_BACKUPS_SEM},mois=${NB_BACKUPS_MOIS} ? O/N : " READPURGE
|
||||
[[ ${READPURGE} =~ ^[oO]$ ]] && Purge || echo "pas de purge"
|
||||
exit
|
||||
;;
|
||||
if [ ! -z ${BACKUPS_KEEP} ]
|
||||
then
|
||||
PURGE_MESS="Ok pour lancer la purge en fonction de ces valeurs : BACKUPS_KEEP=${BACKUPS_KEEP} ? O/N :"
|
||||
else
|
||||
PURGE_MESS="Ok pour lancer la purge en fonction de ces valeurs :jour=${NB_BACKUPS_JOUR},semaine=${NB_BACKUPS_SEM},mois=${NB_BACKUPS_MOIS} ? O/N :"
|
||||
fi
|
||||
read -p "${PURGE_MESS}" READPURGE
|
||||
[[ ${READPURGE} =~ ^[oO]$ ]] && Purge || echo "pas de purge"
|
||||
exit
|
||||
;;
|
||||
'-info' )
|
||||
shift
|
||||
Borginfo
|
||||
|
Loading…
Reference in New Issue
Block a user