issue with logrotate

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

issue with logrotate

Post by 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 {
missingok
rotate 3
hourly
copy
shred
}

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 ?


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

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

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

Re: issue with logrotate

Post by 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.
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

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: issue with logrotate

Post by hunter86_bg » 2018/02/18 15:59:10

Can you provide the output of

Code: Select all

ls -lZd /var/log/controlup

Post Reply