find plus large pour rotation des logs
This commit is contained in:
parent
c26ed2fab2
commit
9668413591
|
@ -298,8 +298,8 @@ LOG_DIR=/var/log/elasticsearch
|
|||
USER=elasticsearch
|
||||
MAX_AGE=365
|
||||
|
||||
find ${LOG_DIR} -type f -user ${USER} -name "*.log.????-??-??" -exec gzip --best {} \;
|
||||
find ${LOG_DIR} -type f -user ${USER} -name "*.log.????-??-??.gz" -ctime +${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
|
||||
~~~
|
||||
|
||||
En l'indiquant dans une crontab elle sera exécutée quand vous le souhaitez, exemple :
|
||||
|
|
Loading…
Reference in a new issue