Log archive maintenance; also clear out symlinks

Currently if a log directory has a symlink it is skipped in the find;
thus the directory does not become empty and it is never removed.
Also match symlinks.

Change-Id: Id34c74d848638182819a9c81d051b83820244463
This commit is contained in:
Ian Wienand 2019-08-06 19:13:44 +10:00
parent f4c637c738
commit 329f330b3e
1 changed files with 1 additions and 1 deletions

View File

@ -6,5 +6,5 @@ find -O3 /srv/static/logs/ -depth -not -name robots.txt -not -name lost+found \
\( -type f -mmin +10 -not -name \*\[.-\]gz -not -name \*\[._-\]\[zZ\] \
\( -name \*.txt -or -name \*.html -or -name tmp\* \) \
-exec gzip \{\} \; \) \
-o \( -type f -mtime +30 -execdir rm \{\} \; \) \
-o \( \( -type f -o -type l \) -mtime +30 -execdir rm \{\} \; \) \
-o \( -type d -empty -mtime +1 -execdir rmdir {} \; \) \)