Logrotate / Crontab not working

General support questions
Post Reply
goncalo.3.ferreira
Posts: 2
Joined: 2022/09/13 06:54:18

Logrotate / Crontab not working

Post by goncalo.3.ferreira » 2022/09/13 07:21:23

Greetings,

Since the 23 oh January of 2022 that /var/log/ files stopped rotating.
Permissions are ok.

After doing cat cron* |grep logrotate we have
Jan 22 03:39:02 vnraidb01-m run-parts(/etc/cron.daily)[42419]: starting logrotate
Jan 22 03:39:02 vnraidb01-m run-parts(/etc/cron.daily)[42459]: finished logrotate
Jan 23 03:10:02 vnraidb01-m run-parts(/etc/cron.daily)[59549]: starting logrotate
[root@vnraidb01-m log]#

So logrotate did not finish for some reason in the 23 of January.

May somebody help me please, since this is affecting all my project servers.

Thank you,

BR//

Gonçalo Ferreira

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: Logrotate / Crontab not working

Post by BShT » 2022/09/13 13:30:20

try to run it manually and see if you have any error

goncalo.3.ferreira
Posts: 2
Joined: 2022/09/13 06:54:18

Re: Logrotate / Crontab not working

Post by goncalo.3.ferreira » 2022/09/13 21:32:44

I cannot run it manually since i need to find the root cause of the issue first. If i run it manually, probably the logs on /var/log will be rotated with the date of today and i cannot do that due to agreements with the company with whom we are working with.

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: Logrotate / Crontab not working

Post by BShT » 2022/09/14 14:22:51

look at logrotate confs

backup log files then rotate

you are 8 months late...

User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Logrotate / Crontab not working

Post by TrevorH » 2022/09/14 18:29:26

If i run it manually, probably the logs on /var/log will be rotated with the date of today and i cannot do that due to agreements with the company with whom we are working with.
You don't have much choice. All your log files will contain entries from the last time that logrotate ran successfully and unless you go through and split them (somehow!) into individual weeks/days/months there's only one file to be rotated.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply