Elasticsearch logs can have multiple patterns
This commit is contained in:
parent
b3ec1f09b6
commit
223bfbdc5a
|
@ -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.????-??-??" -exec gzip --best {} \;
|
||||
find ${LOG_DIR} -type f -user ${USER} -name "*.log.????-??-??.gz" -mtime +${MAX_AGE} -delete
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue