From d241c0575cffab253872b58b6f49d6734b02d57d Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 25 Jun 2013 15:14:38 +0000 Subject: [PATCH] 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 Approved: James E. Blair Reviewed-by: James E. Blair Tested-by: Jenkins --- modules/openstack_project/files/log_archive_maintenance.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/log_archive_maintenance.sh b/modules/openstack_project/files/log_archive_maintenance.sh index 58598a45a8..bce2f30320 100644 --- a/modules/openstack_project/files/log_archive_maintenance.sh +++ b/modules/openstack_project/files/log_archive_maintenance.sh @@ -3,8 +3,9 @@ sleep $((RANDOM%600)) && \ flock -n /var/run/gziplogs.lock \ 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 -name \*\[.-\]gz -not -name \*\[._-\]\[zZ\] \ \( -name \*.txt -or -name \*.html -or -name tmp\* \) \ -exec gzip \{\} \; \) \ -o \( -type f -mtime +183 -name \*.gz -execdir rm \{\} \; \) \