log*: Compress combined-http on a 12 day cycle.

Signed-off-by: James Antill <james@and.org>
This commit is contained in:
James Antill
2025-12-10 11:59:44 -05:00
parent 9048e49e6a
commit c4bdc997e3

View File

@@ -3,10 +3,11 @@
# Compress host log files daily.
0 06 * * * root /usr/bin/find /var/log/hosts -type f -name "*.log" -print | grep -v "$(date +'/\%Y/\%m/\%d/')" | xargs -r -n1 xz -1 > /dev/null
# Compress this days log files from last month in fedora_stats.
# NOTE: We stop on the 28th, the rest will be caught in the monthly.
0 07 1-28 * * root /usr/bin/find "/mnt/fedora_stats/combined-http/$(date --date='1 Month ago' +\%Y/\%m/\%d)" -type f -name "*.log" -print | xargs -r -n 1 -P 2 nice xz -1 > /dev/null
# Compress the log files from 12 days ago, every day. date should just dtrt
# here and don't need the next entry.
0 07 * * * root /usr/bin/find "/mnt/fedora_stats/combined-http/$(date --date='12 Days ago' +\%Y/\%m/\%d)" -type f -name "*.log" -print | xargs -r -n 1 -P 2 nice xz -1 > /dev/null
# Compress entire month from _two_ months ago log files in fedora_stats.
# Everything should be already compressed, but just in case.
# NOTE: We don't do it on the 1st for an abundance of caution.
0 08 8 * * root /usr/bin/find "/mnt/fedora_stats/combined-http/$(date --date='2 Month ago' +\%Y/\%m)" -type f -name "*.log" -print | xargs -r -n 1 -P 2 nice xz -1 > /dev/null