Compare commits

...

1 commit

Author SHA1 Message Date
Bruno TATU a695bec780 Compress logs about garbage collector for elasticsearch
All checks were successful
continuous-integration/drone/push Build is passing
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
2021-02-11 12:31:30 +01:00

View file

@ -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