diff --git a/roles/mongodb/templates/mongodb-backup.sh.j2 b/roles/mongodb/templates/mongodb-backup.sh.j2 index 2cca05a..fc415e8 100755 --- a/roles/mongodb/templates/mongodb-backup.sh.j2 +++ b/roles/mongodb/templates/mongodb-backup.sh.j2 @@ -8,9 +8,9 @@ DESTDIR="/srv/backup" DATE="$(date +%Y-%m-%d)" cd "$DESTDIR" -find . -xdev -mindepth 2 -maxdepth 2 -type f -mtime +30 \ +find . -xdev -mindepth 3 -maxdepth 3 -type f -mtime +30 \ -execdir rm -f -- {} \; -find . -xdev -depth -mindepth 1 -maxdepth 1 -type d -empty \ +find . -xdev -depth -mindepth 1 -maxdepth 2 -type d -empty \ -execdir rmdir -- {} \; mkdir -m 2750 "$DATE"