issue with logrotate

Issues related to applications and software problems
Posts: 1
Joined: 2018/02/18 07:47:34

issue with logrotate

Postby amityr » 2018/02/18 08:24:21

Hi all,

Using Centos 7.4.1708 3.10.0-693.11.1.el7.x86_64
have logrotate installed : logrotate-3.8.6-14.el7.x86_64

i have added a /etc/logrotate.d/control:
/var/log/controlup/test.log {
rotate 3

when i run logrotate -vdf /etc/logrotate.d/control i get :
# logrotate -vdf /etc/logrotate.d/control
reading config file /etc/logrotate.d/control
Allocating hash table for state file, size 15360 B

Handling 1 logs

rotating pattern: /var/log/controlup/test.log forced from command line (3 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/controlup/test.log
log needs rotating
rotating log /var/log/controlup/test.log, log->rotateCount is 3
dateext suffix '-2018021810'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/controlup/test.log.3 to /var/log/controlup/test.log.4 (rotatecount 3, logstart 1, i 3),
renaming /var/log/controlup/test.log.2 to /var/log/controlup/test.log.3 (rotatecount 3, logstart 1, i 2),
renaming /var/log/controlup/test.log.1 to /var/log/controlup/test.log.2 (rotatecount 3, logstart 1, i 1),
renaming /var/log/controlup/test.log.0 to /var/log/controlup/test.log.1 (rotatecount 3, logstart 1, i 0),
copying /var/log/controlup/test.log to /var/log/controlup/test.log.1
Not truncating /var/log/controlup/test.log
removing old log /var/log/controlup/test.log.4
error: error opening /var/log/controlup/test.log.4: No such file or directory

and nothing is being rotated.
no new was created, nothing was rotated.
exit status is 1

any thought ?

/var/lib/logrotate/logrotate.status is clean.
not being updated.

i am thinkng of a bug in logrotate at the moment.

User avatar
Forum Moderator
Posts: 22013
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: issue with logrotate

Postby TrevorH » 2018/02/18 11:50:16

-d, --debug
Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate
state file.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

Posts: 953
Joined: 2015/02/17 15:14:33
Location: Bulgaria

Re: issue with logrotate

Postby hunter86_bg » 2018/02/18 15:59:10

Can you provide the output of

Code: Select all

ls -lZd /var/log/controlup