0

My logrotate works perfectly, except for this configuration:

/var/awdata/awarchive.*.log 
/var/log/awstats.log 
{
        rotate 12
}

This is my logrotate -d /etc/logorate.conf output:

considering log /var/awdata/awarchive.domain1.it.log
   log needs rotating

and then:

rotating log /var/awdata/awarchive.domain1.it.log, log->rotateCount is 4
dateext suffix '-20120517'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to unconfined_u:object_r:var_t:s0
renaming /var/awdata/awarchive.domain1.it.log to /var/awdata/awarchive.domain1.it.log-20120517
creating new /var/awdata/awarchive.domain1.it.log mode = 0666 uid = 99 gid = 501

logrotate seems to work perfectly, but it does not do what I wrote. :-(

==

ls -lah /var/awdata/*domain1*

About domain1:

-rw-rw-rw-. 1 nobody nogroup 4.7G May 17 17:16 /var/awdata/awarchive.domain1.it.log
-rw-rw-rw-. 1 nobody nogroup 7.6G May  9 04:16 /var/awdata/awarchive.domain1.it.log-20120509

The only rotate log *-20120509 was forced with the -f option.

[root@lnx1 awdata]# ls -ld /var/awdata
drwxr-xr-x. 2 nobody nogroup 188416 May 17 18:52 /var/awdata

Any ideas?

8
  • 1
    can you provide the output of ls -lah /var/awdata/ so we can see what actually was rotated?
    – Tom
    May 17, 2012 at 11:53
  • 1
    -d Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file.
    – jirib
    May 17, 2012 at 16:37
  • Be careful, if you do not have space in filesystem, it won't be rotated, this is my experience.
    – jirib
    May 17, 2012 at 16:38
  • Is /var/awdata writable for logrrotate? It wants create the files with uid 99 gid 501 while the existing files' owner is nobody/nogroup. Maybe you need to chmod /var/awdata to 1777 mode? Show ls -ld /var/awdara.
    – ott--
    May 17, 2012 at 16:43
  • i've got space enough :-) now, i force rotation (-f) and works perfectly... :-(
    – Roberto
    May 17, 2012 at 16:56

1 Answer 1

2

Note that logrotate -d turns on “debug” mode, where logrotate reports what it would do if the -d flag was not present.

Try using logrotate -v, which applies the actions it describes, then come back with any further issues.

Not the answer you're looking for? Browse other questions tagged .