From: Matt McCutchen Date: Fri, 18 Sep 2020 14:38:46 +0000 (-0400) Subject: web-logs/Makefile: Use only the previous day's logs to avoid overlap. X-Git-Url: https://mattmccutchen.net/utils/utils.git/commitdiff_plain/e05b3ea6ad0a1f63d4dd38e88a2d3382772d6164?hp=9ed13607e562a4b8a7c70381d0e30b70d1834093 web-logs/Makefile: Use only the previous day's logs to avoid overlap. --- 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 $^ >$@