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:
parent
f4c637c738
commit
329f330b3e
@ -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 {} \; \) \)
|
||||
|
Loading…
x
Reference in New Issue
Block a user