correction des purge
This commit is contained in:
parent
06fe194dcc
commit
56f0021635
@ -21,7 +21,7 @@ setKazVars
|
|||||||
. $DOCKERS_ENV
|
. $DOCKERS_ENV
|
||||||
. $KAZ_ROOT/secret/SetAllPass.sh
|
. $KAZ_ROOT/secret/SetAllPass.sh
|
||||||
|
|
||||||
VERSION="V-13-10-2024"
|
VERSION="V-3-11-2024"
|
||||||
PRG=$(basename $0)
|
PRG=$(basename $0)
|
||||||
RACINE=$(echo $PRG | awk '{print $1}')
|
RACINE=$(echo $PRG | awk '{print $1}')
|
||||||
#IFS=' '
|
#IFS=' '
|
||||||
@ -140,10 +140,17 @@ Sauvegarde() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Purge() {
|
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=$?
|
PRUNE_EXIT=$?
|
||||||
|
else
|
||||||
|
borg prune --keep-daily ${NB_BACKUPS_JOUR} --keep-weekly ${NB_BACKUPS_SEM} --keep-monthly ${NB_BACKUPS_MOIS}
|
||||||
|
PRUNE_EXIT=$?
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Compact() {
|
Compact() {
|
||||||
|
|
||||||
borg compact --progress ${BORG_REPO}
|
borg compact --progress ${BORG_REPO}
|
||||||
@ -160,7 +167,7 @@ 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}"
|
||||||
echo "-m : Monte le REPO (${BORG_REPO} sur ${BORGMOUNT})"
|
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 "-s : Lance la sauvegarde"
|
||||||
echo "-u : Demonte le REPO (${BORG_REPO} de ${BORGMOUNT})"
|
echo "-u : Demonte le REPO (${BORG_REPO} de ${BORGMOUNT})"
|
||||||
echo "-v : Version"
|
echo "-v : Version"
|
||||||
@ -419,7 +426,13 @@ for ARG in $@; do
|
|||||||
;;
|
;;
|
||||||
'-p' )
|
'-p' )
|
||||||
shift
|
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
|
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"
|
[[ ${READPURGE} =~ ^[oO]$ ]] && Purge || echo "pas de purge"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user