From a2542d8feaf3d968aa8c2254e8b5640999722dbc Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 16 Aug 2024 08:45:49 +0200 Subject: [PATCH] ajout de -info scriptBorg --- bin/.scriptBorg-completion.bash | 2 +- bin/scriptBorg.sh | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/bin/.scriptBorg-completion.bash b/bin/.scriptBorg-completion.bash index 79160a7..53850b7 100644 --- a/bin/.scriptBorg-completion.bash +++ b/bin/.scriptBorg-completion.bash @@ -8,7 +8,7 @@ _borg() local current=${COMP_WORDS[COMP_CWORD]} case "$current" in -*) - local_prop="-h -d -i -l -m -u -t -p -v" + local_prop="-h -d -i -l -m -u -t -p -v -info" COMPREPLY=( $(compgen -W "${local_prop}" -- $current) ) ;; esac diff --git a/bin/scriptBorg.sh b/bin/scriptBorg.sh index 410546c..500d212 100755 --- a/bin/scriptBorg.sh +++ b/bin/scriptBorg.sh @@ -21,7 +21,7 @@ setKazVars . $DOCKERS_ENV . $KAZ_ROOT/secret/SetAllPass.sh -VERSION="V-18-05-2024" +VERSION="V-16-08-2024" PRG=$(basename $0) RACINE=$(echo $PRG | awk '{print $1}') #IFS=' ' @@ -137,9 +137,9 @@ Sauvegarde() { Purge() { borg prune \ --prefix '{hostname}-' \ - --keep-daily ${NB_BACKUPS_JOUR} \ - --keep-weekly ${NB_BACKUPS_SEM} \ - --keep-monthly ${NB_BACKUPS_MOIS} \ + --keep-daily=${NB_BACKUPS_JOUR} \ + --keep-weekly=${NB_BACKUPS_SEM} \ + --keep-monthly=${NB_BACKUPS_MOIS} \ PRUNE_EXIT=$? } @@ -156,6 +156,7 @@ echo "-h : Usage" echo "-c : Permet de compacter ${BORG_REPO}" echo "-d : Permet de verifier les variables de sauvegarde" 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}" @@ -215,6 +216,11 @@ Borglist() { exit } +Borginfo() { + LogFic "Borg info demandé" + borg info ${BORG_REPO} + exit +} main() { # ****************************************************** Main ******************************************************************* @@ -378,6 +384,11 @@ for ARG in $@; do [[ ${READPURGE} =~ ^[oO]$ ]] && Purge || echo "pas de purge" exit ;; + '-info' ) + shift + Borginfo + exit + ;; * | ' ' ) usage ;;