Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

My logrotate works perfectly, except for this configuration:

        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?

share|improve this question

marked as duplicate by HopelessN00b Feb 20 at 3:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

can you provide the output of ls -lah /var/awdata/ so we can see what actually was rotated? –  Tom H May 17 '12 at 11:53
thanks for your hint tom :-) –  Roberto May 17 '12 at 16:27
-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. –  Jiri Xichtkniha May 17 '12 at 16:37
Be careful, if you do not have space in filesystem, it won't be rotated, this is my experience. –  Jiri Xichtkniha May 17 '12 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 '12 at 16:43

1 Answer 1

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.