mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-05-01 05:51:56 +08:00
13 lines
851 B
Plaintext
13 lines
851 B
Plaintext
# 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
|
|
# 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
|
|
|