# Logrotate issues

**URL:** <https://forums.rockylinux.org/t/logrotate-issues/10673>\
**Category:** Rocky Linux Help & Support\
**Created:** [July 12, 2023, 4:29pm UTC](https://forums.rockylinux.org/t/logrotate-issues/10673 "2023-07-12T16:29:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwilde](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@cwilde](https://forums.rockylinux.org/u/cwilde)\
**Post date:** [July 12, 2023, 4:29pm UTC](https://forums.rockylinux.org/t/logrotate-issues/10673/1 "2023-07-12T16:29:57Z")

</div>

I am having issues with logrotate and would like some help. I have exim installed on a system and I am trying to get the logs to rotate at 2359. I have a cron job setup to rotate the log but it appears that it will also run at random times. I do not have my config in /etc/logrotate.d/ directory.

59 23 \* \* \* /usr/sbin/logrotate -f /etc/logrotate.exim/exim \> /dev/null

Here is the exim rotate file :

/var/log/exim/main.log /var/log/exim/panic.log /var/log/exim/reject.log {  
su exim exim  
compress  
compresscmd /usr/bin/gzip  
uncompresscmd /usr/bin/gunzip  
dateext  
dateformat -%Y-%m-%d  
rotate 30  
missingok  
}

Here you can see that they are rotating at random times :

-rw-r----- 1 exim exim 269 Jul 10 23:10 panic.log-2023-07-10.gz  
-rw-r----- 1 exim exim 77696 Jul 10 23:56 reject.log-2023-07-10.gz  
-rw-r----- 1 exim exim 115169 Jul 10 23:56 main.log-2023-07-10.gz

Any thoughts on why they rotate at random times? On other linux systems this works fine.

---

<div class="post-metadata">

**Author:** ![dali](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dali](https://forums.rockylinux.org/u/dali)\
**Post date:** [July 12, 2023, 5:58pm UTC](https://forums.rockylinux.org/t/logrotate-issues/10673/2 "2023-07-12T17:58:04Z")

</div>

Check the last entries in the files, they were probably not changed between last entry and the log rotation time.

---

<div class="post-metadata">

**Author:** ![cwilde](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@cwilde](https://forums.rockylinux.org/u/cwilde)\
**Post date:** [July 12, 2023, 6:13pm UTC](https://forums.rockylinux.org/t/logrotate-issues/10673/3 "2023-07-12T18:13:25Z")

</div>

Yes, that does appear to be the case for most of them. I will keep an eye on it. Thanks.
