From e05b3ea6ad0a1f63d4dd38e88a2d3382772d6164 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Fri, 18 Sep 2020 10:38:46 -0400 Subject: [PATCH] web-logs/Makefile: Use only the previous day's logs to avoid overlap. --- web-logs/Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web-logs/Makefile b/web-logs/Makefile index c338031..9db4475 100644 --- a/web-logs/Makefile +++ b/web-logs/Makefile @@ -43,12 +43,14 @@ log_line_regex := ^([^ ]+)( [^"]*)"(([^"\\]|\\.)*)" ([0-9]+) ([^"]*)"(([^"\\]|\\ # \7: referrer (ditto \3) # \9: user agent (ditto \3) -# Take the current and previous day's logs. If I look once a day (DreamHost time), -# this should catch everything with some overlap. TODO: Avoid the overlap? -# Requires sth more sophisticated to track what I've already seen. +# Take the previous day's logs. If I look once a day (DreamHost time), this +# should catch everything with no overlap. I previously included the current +# day's logs, but I now think the difficulty of maintaining an accurate sense of +# usage in the presence of overlap is a greater evil than up to a day of extra +# latency. I might find a better solution in the future. # # Filename pattern for recent-logs is locked down in pull-logs, so we shouldn't have shell injection here. -recent_logs := $(shell ls -t recent-logs/access.log* | head -n 2 | tac) +recent_logs := $(shell ls -t recent-logs/access.log* | head -n 2 | tail -n 1 | tac) $G/logs: $(recent_logs) cat $^ >$@ -- 2.34.1