diff --git a/roles/base/files/compress-log.cron b/roles/base/files/compress-log.cron index 5da9b525e6..d6f65a1453 100644 --- a/roles/base/files/compress-log.cron +++ b/roles/base/files/compress-log.cron @@ -1,10 +1,12 @@ +# Note % in the CMD is \n unless escaped: + # 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 +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 entire month from _two_ months ago log files in fedora_stats. # 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 +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