# Cron+curator+logrotate are not work?

**URL:** <https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409>\
**Category:** Elasticsearch\
**Tags:** curator\
**Created:** [January 18, 2021, 10:40am UTC](https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409 "2021-01-18T10:40:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tabriz](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tabriz](https://discuss.elastic.co/u/Tabriz)\
**Post date:** [January 18, 2021, 10:40am UTC](https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409/1 "2021-01-18T10:40:30Z")

</div>

l made a schedule for delete old logs from elasticsearch.  
The command is that 30 0 \* \* \* curator delete indices --time-unit days --timestring '%Y.%m.%d' --older-than 270

but the command doesn't wokr and even the logrotate doesn't work for elasticsearch log

/var/log/elasticsearch/\* {  
monthly  
rotate 12  
compress  
delaycompress  
}

curator version is 3.3.0  
python version 2.6.6

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [January 19, 2021, 4:52am UTC](https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409/2 "2021-01-19T04:52:58Z")

</div>

So, Curator's current release version is 5.8.3. Python 2.7 has been EOL for over a year (December 31, 2019).

I'm not sure what your environment is, but neither of those is supported anymore. I'm happy to help if you upgrade to recent versions.

---

<div class="post-metadata">

**Author:** ![Tabriz](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@Tabriz](https://discuss.elastic.co/u/Tabriz)\
**Post date:** [January 19, 2021, 10:15am UTC](https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409/3 "2021-01-19T10:15:56Z")

</div>

Sir.Logrotate doesn't work for elasticsearch logs . What may be reason?  
for example my elasticsearch log file directory is /var/log/elasticsearch/ there are such files elasticsearch.log.2010-01-05

how l must to write director for logrotate  
/var/log/elasticsearch/\*.log.[0-9]?

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [January 19, 2021, 3:05pm UTC](https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409/4 "2021-01-19T15:05:13Z")

</div>

I have no idea what version of Elasticsearch you are using, and still have no idea which version of Linux you are using (given the extremely outdated version of Python).

Elasticsearch should not be configured to rotate logs via logrotate, but with [Elasticsearch's own logging configuration](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/logging.html). These instructions are for the most recent release (7.10 at this writing) of Elasticsearch.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 16, 2021, 3:05pm UTC](https://discuss.elastic.co/t/cron-curator-logrotate-are-not-work/261409/5 "2021-02-16T15:05:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
