system-config/modules/openstack_project/files/log_archive_maintenance.sh
Jeremy Stanley fa1930aaf9 Don't compress log help files.
* modules/openstack_project/files/log_archive_maintenance.sh: The
log compression script no longer attempts to compress files stored
in the help subdirectory of the site document root.

Change-Id: I1db1dead0608c10b71dd3d91c1fedc2d7cc06926
Reviewed-on: https://review.openstack.org/34263
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
2013-06-24 22:31:12 +00:00

18 lines
643 B
Bash

#!/bin/sh
sleep $((RANDOM%600)) && \
flock -n /var/run/gziplogs.lock \
find /srv/static/logs/ -depth \
\( \
\( -type f -not -name robots.txt -not -name \*.gz \
-not -wholename /srv/static/logs/help/\* \
\( -name \*.txt -or -name \*.html -or -name tmp\* \) \
-exec gzip \{\} \; \) \
-o \( -type f -mtime +183 -name \*.gz -execdir rm \{\} \; \) \
-o \( -type d -empty -mtime +1 -execdir rmdir {} \; \) \
\)
find /srv/static/docs-draft/ -depth \
\( \
\( -type f -mtime +30 -name \*.gz -execdir rm \{\} \; \) \
-o \( -type d -empty -mtime +1 -execdir rmdir {} \; \) \
\)