mongodb: Fix removing old backups
This commit is contained in:
parent
5865d0da5c
commit
4f408bac9d
1 changed files with 2 additions and 2 deletions
|
@ -8,9 +8,9 @@ DESTDIR="/srv/backup"
|
||||||
DATE="$(date +%Y-%m-%d)"
|
DATE="$(date +%Y-%m-%d)"
|
||||||
|
|
||||||
cd "$DESTDIR"
|
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 -- {} \;
|
-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 -- {} \;
|
-execdir rmdir -- {} \;
|
||||||
|
|
||||||
mkdir -m 2750 "$DATE"
|
mkdir -m 2750 "$DATE"
|
||||||
|
|
Loading…
Add table
Reference in a new issue