Don't try to compress patterns ignored by gzip.

* modules/openstack_project/files/log_archive_maintenance.sh:
According to the gzip manpage, there are a variety of filename
endings it will consider to indicate a file is already compressed
and will then refuse to compress. Some tempfiles get
randomly-generated names which match these endings, causing the
compression cron job to emit errors. Instead we make the script skip
over them.

Change-Id: Ib78a19362eaa54c43f44a9e6bd0c265dddee92be
Reviewed-on: https://review.openstack.org/34419
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Jeremy Stanley 2013-06-25 15:14:38 +00:00 committed by Jenkins
parent a590e41d90
commit d241c0575c

View File

@ -3,8 +3,9 @@ sleep $((RANDOM%600)) && \
flock -n /var/run/gziplogs.lock \ flock -n /var/run/gziplogs.lock \
find /srv/static/logs/ -depth \ find /srv/static/logs/ -depth \
\( \ \( \
\( -type f -not -name robots.txt -not -name \*.gz \ \( -type f -not -name robots.txt \
-not -wholename /srv/static/logs/help/\* \ -not -wholename /srv/static/logs/help/\* \
-not -name \*\[.-\]gz -not -name \*\[._-\]\[zZ\] \
\( -name \*.txt -or -name \*.html -or -name tmp\* \) \ \( -name \*.txt -or -name \*.html -or -name tmp\* \) \
-exec gzip \{\} \; \) \ -exec gzip \{\} \; \) \
-o \( -type f -mtime +183 -name \*.gz -execdir rm \{\} \; \) \ -o \( -type f -mtime +183 -name \*.gz -execdir rm \{\} \; \) \