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"