Compress logs about garbage collector for elasticsearch

Whitout this improvement, this logs cannot be compressed:
/var/log/elasticsearch/gc.log.02
/var/log/elasticsearch/gc.log.29
/var/log/elasticsearch/gc.log.12
/var/log/elasticsearch/gc.log.18
pull/124/head
Bruno TATU 2 years ago committed by Jérémy Lecour
parent 32f2a29161
commit 33837844ee

@ -5,5 +5,5 @@ LOG_DIR=/var/log/elasticsearch
USER=elasticsearch
MAX_AGE={{ elasticsearch_log_rotate_days | mandatory }}
find ${LOG_DIR} -type f -user ${USER} \( -name "*.log.????-??-??" -o -name "*-????-??-??.log" \) -exec gzip --best {} \;
find ${LOG_DIR} -type f -user ${USER} \( -name "*.log.????-??-??.gz" -o -name "*-????-??-??.log.gz" \) -ctime +${MAX_AGE} -delete
find ${LOG_DIR} -type f -user ${USER} \( -name "*.log.??" -o -name "*.log.????-??-??" -o -name "*-????-??-??.log" \) -not -name "*.gz" -exec gzip --best {} \;
find ${LOG_DIR} -type f -user ${USER} \( -name "*.log.??.gz" -o -name "*.log.????-??-??.gz" -o -name "*-????-??-??.log.gz" \) -ctime +${MAX_AGE} -delete

Loading…
Cancel
Save