2013-04-03 22:34:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
sleep $((RANDOM%600)) && \
|
|
|
|
flock -n /var/run/gziplogs.lock \
|
2014-05-20 20:54:13 +00:00
|
|
|
find -O3 /srv/static/logs/ -depth -not -name robots.txt -not -name lost+found \
|
|
|
|
-not -wholename /srv/static/logs/help/\* \( \
|
|
|
|
\( -type f -mmin +10 -not -name \*\[.-\]gz -not -name \*\[._-\]\[zZ\] \
|
|
|
|
\( -name \*.txt -or -name \*.html -or -name tmp\* \) \
|
|
|
|
-exec gzip \{\} \; \) \
|
|
|
|
-o \( -type f -mtime +120 -execdir rm \{\} \; \) \
|
2014-06-02 18:15:37 +00:00
|
|
|
-o \( -type d -empty -mtime +1 -execdir rmdir {} \; \) \)
|
2014-05-20 20:54:13 +00:00
|
|
|
find -O3 /srv/static/docs-draft/ -depth -not -name lost+found \( \
|
2014-07-28 16:00:39 +00:00
|
|
|
\( -type f -mtime +21 -execdir rm \{\} \; \) \
|
2014-05-20 20:54:13 +00:00
|
|
|
-o \( -type d -empty -mtime +1 -execdir rmdir {} \; \) \)
|