backup: ignorer le dossier kept lors de l'application de la rétention
This commit is contained in:
parent
a21fe22b27
commit
bad78bb572
@ -123,7 +123,7 @@ fi
|
|||||||
####################################################################################
|
####################################################################################
|
||||||
## TRAITEMENT (retention)
|
## TRAITEMENT (retention)
|
||||||
# Appliquer la rétention sur le dossier de l'hôte
|
# 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
|
# Si des sauvegardes de conteneurs existent
|
||||||
if [[ "$(/bin/ls ${containersPath})" ]]; then
|
if [[ "$(/bin/ls ${containersPath})" ]]; then
|
||||||
@ -136,7 +136,7 @@ if [[ "$(/bin/ls ${containersPath})" ]]; then
|
|||||||
hostname | tee "${containersPath}/${scriptName}.lock"
|
hostname | tee "${containersPath}/${scriptName}.lock"
|
||||||
|
|
||||||
# Appliquer la rétention
|
# 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
|
# Supprimer le lock
|
||||||
rm "${containersPath}/${scriptName}.lock"
|
rm "${containersPath}/${scriptName}.lock"
|
||||||
|
Loading…
Reference in New Issue
Block a user