Add script to compress log files every month to reduce storage

Signed-off-by: Pedro Moura <pmoura@redhat.com>
This commit is contained in:
Pedro Moura 2023-07-10 13:11:45 -03:00 committed by kevin
parent 7d7d0bf0a8
commit 1b05dd52ba
3 changed files with 12 additions and 0 deletions

View file

@ -0,0 +1,5 @@
#!/bin/bash
LOGS_PATH='/mnt/fedora_stats/combined-http'
find $LOGS_PATH/20?? -type f -name -not -path $LOGS_PATH/`date +%Y`/`date +%m`/* "*.log" -exec xz -z {} \;

View file

@ -1,2 +1,3 @@
MAILTO=root@fedoraproject.org,nils@redhat.com,asaleh@redhat.com
0 06 * * * root /usr/local/bin/condense-mirrorlogs.sh > /dev/null
0 09 5 * * root /usr/local/bin/compress_logs.sh > /dev/null

View file

@ -241,3 +241,9 @@
tags:
- web-data
- cron
- name: Compress logs script (log01)
copy: src=compress_logs.sh dest=/usr/local/bin/ mode=0755
tags:
- config
- web-data