1
0

backup: ignorer le dossier kept lors de l'application de la rétention

This commit is contained in:
pulsar89.5 2021-11-04 11:24:49 +01:00
parent a21fe22b27
commit bad78bb572

View File

@ -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"