From 968e77129b16bb4faacec8c5481d6716c06eb079 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 12 Aug 2013 21:23:40 +0000 Subject: [PATCH] Don't compress very, very recent log files * modules/openstack_project/files/log_archive_maintenance.sh: On occasion the compressor will be engaged on a file which is still being written to the log archive, resulting in a compressed but truncated copy along with the original it lacked the write lock to unlink. Then on a subsequent pass, this file will be skipped because the destination filename already exists. Instead, don't compress a file unless its last modified time is more than 10 minutes in the past. Change-Id: Ife874784babd41aa45b4183f4f0a5a5730cf5a23 --- modules/openstack_project/files/log_archive_maintenance.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openstack_project/files/log_archive_maintenance.sh b/modules/openstack_project/files/log_archive_maintenance.sh index 56701dd2ce..3824651544 100644 --- a/modules/openstack_project/files/log_archive_maintenance.sh +++ b/modules/openstack_project/files/log_archive_maintenance.sh @@ -3,7 +3,7 @@ sleep $((RANDOM%600)) && \ flock -n /var/run/gziplogs.lock \ find /srv/static/logs/ -depth \ \( \ - \( -type f -not -name robots.txt \ + \( -type f -mmin +10 -not -name robots.txt \ -not -wholename /srv/static/logs/help/\* \ -not -name \*\[.-\]gz -not -name \*\[._-\]\[zZ\] \ \( -name \*.txt -or -name \*.html -or -name tmp\* \) \