5

I have a logrotate conf:

/myapps/log.log {
  missingok
  notifempty
  rotate 9
  copy
}

then when I run /usr/sbin/logrotate -d -f logrotate.conf

it gives error:

renaming /myapps/log.log.2 to /myapps/log.log.3 (rotatecount 2, logstart 1, i 2)
renaming /myapps/log.log.1 to /myapps/log.log.2 (rotatecount 2, logstart 1, i 1)
renaming /myapps/log.log.0 to /myapps/log.log.1 (rotatecount 2, logstart 1, i 0)
copying /myapps/log.log to /myapps/log.log.1
Not truncating /myapps/log.log.3
error: error opening /myapps/log.log.3: No such file or directory

I don't have the log.log.3 yet, so it does not exist, but because of this, logrotate is not working at all, how can I fix it.

Jakim
  • 1,713
  • 7
  • 20
  • 44

1 Answers1

0

After running into this myself, I learned that the -d flag will run logrotate in debug mode, where it will not actually do anything except throw that error. Try running it not in debug mode, my guess is that it fixes your problem.

https://github.com/logrotate/logrotate/issues/165

Toby Chin
  • 51
  • 3