This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push: new a6d8ecd backend: fix /bin/copr-compress-live-logs a6d8ecd is described below
commit a6d8ecd097b4fdfdada43e98f6b641fdd0c35ddf Author: Pavel Raiskup praiskup@redhat.com AuthorDate: Wed Sep 18 09:24:39 2019 +0200
backend: fix /bin/copr-compress-live-logs
Fix wrongly used `-mtime` option, we needed s/7/+7/. While touching the script, make it a bit more verbose.
Merges: #1009 --- backend/run/copr-compress-live-logs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/backend/run/copr-compress-live-logs b/backend/run/copr-compress-live-logs index 98eff8b..37b7d8f 100755 --- a/backend/run/copr-compress-live-logs +++ b/backend/run/copr-compress-live-logs @@ -4,6 +4,7 @@ # and gzip them (or remove, if the corresponding gzipped file already exists).
die() { echo "$0: FATAL: $*" ; exit 1 ; } +info() { echo "$0: INFO: $*" ; }
test "$#" -lt 1 && die "<dir> argument expected"
@@ -12,12 +13,14 @@ dir=$1 test -d "$dir" || die "'$dir' is not a directory"
# make sure we use -mtime to not hit logs for actually running builds -find "$dir" -name builder-live.log -mtime 7 -type f | \ +find "$dir" -name builder-live.log -mtime +7 -type f | \ while read -r uncompressed; do compressed="$uncompressed.gz" if test -f "$compressed"; then + info "removing uncompressed file: $uncompressed" rm -f "$uncompressed" else + info "gzipping old file: $uncompressed" gzip "$uncompressed" fi done