From bad78bb5720a33c06ee06a7bc95e123ca12edc96 Mon Sep 17 00:00:00 2001 From: Alexandre LE GALL Date: Thu, 4 Nov 2021 11:24:49 +0100 Subject: [PATCH] =?UTF-8?q?backup:=20ignorer=20le=20dossier=20kept=20lors?= =?UTF-8?q?=20de=20l'application=20de=20la=20r=C3=A9tention?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup/run.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup/run.bash b/backup/run.bash index e77de33..ec7c6ca 100755 --- a/backup/run.bash +++ b/backup/run.bash @@ -123,7 +123,7 @@ fi #################################################################################### ## TRAITEMENT (retention) # Appliquer la rétention sur le dossier de l'hôte -[[ "$(/bin/ls ${hostPath})" ]] && find ${hostPath}/* -mtime "+${retentionPolicy}" -exec rm {} \; +[[ "$(/bin/ls ${hostPath})" ]] && find ${hostPath}/* ! -path "*kept*" -mtime "+${retentionPolicy}" -exec rm {} \; # Si des sauvegardes de conteneurs existent if [[ "$(/bin/ls ${containersPath})" ]]; then @@ -136,7 +136,7 @@ if [[ "$(/bin/ls ${containersPath})" ]]; then hostname | tee "${containersPath}/${scriptName}.lock" # Appliquer la rétention - [[ "$(/bin/ls ${containersPath})" ]] && find ${containersPath}/* -mtime "+${retentionPolicy}" -exec rm {} \; + [[ "$(/bin/ls ${containersPath})" ]] && find ${containersPath}/* ! -path "*kept*" -mtime "+${retentionPolicy}" -exec rm {} \; # Supprimer le lock rm "${containersPath}/${scriptName}.lock"