My Oracle Support Banner

Oracle Linux 7: 'logrotate' Command not Compressing or Rotating Log Files Under /var/log Directory (Doc ID 2648839.1)

Last updated on APRIL 01, 2020

Applies to:

Linux OS - Version Oracle Linux 7.0 and later
Linux x86-64


Daily cronjob, logrotate is executed but it is not compress neither rotate logs under /var/log/ folder. 

#ls  /var/log -hs
96K /var/log/cron
100K /var/log/cron-20200126
92K /var/log/cron-20200127
100K /var/log/cron-20200128
96K /var/log/cron-20200129
100K /var/log/cron-20200130
96K /var/log/cron-20200131
96K /var/log/cron-20200201
96K /var/log/cron-20200202
96K /var/log/cron-20200203
96K /var/log/cron-20200204
96K /var/log/cron-20200205
96K /var/log/cron-20200206
104K /var/log/cron-20200207
8.0K /var/log/secure
24K /var/log/secure-20200123
12K /var/log/secure-20200124
8.0K /var/log/secure-20200125
20K /var/log/secure-20200128
12K /var/log/secure-20200129
8.0K /var/log/secure-20200130
8.0K /var/log/secure-20200131
8.0K /var/log/secure-20200201
8.0K /var/log/secure-20200202
8.0K /var/log/secure-20200203
8.0K /var/log/secure-20200204
8.0K /var/log/secure-20200205
706M /var/log/messages
665M /var/log/messages-20200218
653M /var/log/messages-20200219
649M /var/log/messages-20200220
646M /var/log/messages-20200221
655M /var/log/messages-20200222
635M /var/log/messages-20200223
634M /var/log/messages-20200224
645M /var/log/messages-20200225
413M /var/log/messages-20200226
24M /var/log/messages-20200227
167M /var/log/messages-20200228
199M /var/log/messages-20200229
590M /var/log/messages-20200301

From the debug output shows an only error with date format

dateext suffix '-20181008' 
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /var/log/secure already exists, skipping rotation 


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.