From 7933637a275332776c78b54131b500a0981234de Mon Sep 17 00:00:00 2001 From: Michiel Meeuwissen Date: Sun, 19 Jan 2025 11:06:58 +0100 Subject: [PATCH] Lets keep it a bit cleaner. --- Dockerfile | 5 +++-- catalina_base/bin/setenv.sh | 2 -- parse_tomcat_access_logs.pl | 5 ++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a07ee34..9d9f3b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -89,7 +89,8 @@ COPY binbash /.binbash # - Setting up timezone and stuff RUN echo "dash dash/sh boolean false" | debconf-set-selections && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash && \ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ - dpkg-reconfigure --frontend noninteractive tzdata + dpkg-reconfigure --frontend noninteractive tzdata && \ + mkdir -p /scripts # With bearable key bindings: @@ -103,7 +104,7 @@ COPY exrc /.exrc COPY bash.bashrc /etc/bash.bashrc # A script that can parse our access logs -COPY parse_tomcat_access_logs.pl / +COPY parse_tomcat_access_logs.pl /scripts # some files which might be needed during build diff --git a/catalina_base/bin/setenv.sh b/catalina_base/bin/setenv.sh index 2a9eadd..f42b037 100644 --- a/catalina_base/bin/setenv.sh +++ b/catalina_base/bin/setenv.sh @@ -120,5 +120,3 @@ if [ -z ${TOMCAT_ACCEPT_COUNT+x} ]; then export TOMCAT_ACCEPT_COUNT=100 fi -# 'parse -find / -type f -executable -name "parse*" -print -exec cp "{}" /tmp \; diff --git a/parse_tomcat_access_logs.pl b/parse_tomcat_access_logs.pl index e8e8e80..1dd5e39 100755 --- a/parse_tomcat_access_logs.pl +++ b/parse_tomcat_access_logs.pl @@ -10,7 +10,6 @@ =head1 parse_tomcat_access_logs() - max age in minutes (defaults to 1440, one day) - =cut use strict; @@ -22,6 +21,10 @@ =head1 parse_tomcat_access_logs() if (scalar(@ARGV) ge 1) { $age = $ARGV[0]; } +my $now="\${dateset_date}"; +if (scalar(@ARGV) ge 2) { + $now= $ARGV[1]; +} my $after =`date --iso-8601=minutes --date="\${dataset_date} -$age minute"`; my $findcommand="find $dir -cmin -$age -name 'tomcat_access.log*'";