-1

Log rotate doesn't work very well.

So, when i execute command, I got a below error first time.

$ logrotate /etc/logrotate.d/systemname

error: error creating output file /var/lib/logrotate/logrotate.status.tmp: Permission denied

then i changed /var/lib/logrotate/ to 666

Error message change like below.

$ logrotate -f /etc/logrotate.d/systemname

error: error stat()ing state file /var/lib/logrotate/logrotate.status: Permission denied

Help me, how to solve this problem?

thanks.

Nicolás Alarcón Rapela
  • 2,714
  • 1
  • 18
  • 29
mbt
  • 29
  • 9
  • 1
    `/etc` is the domain of the root user; execute `logrotate` with `root` permissions. Typically `logrotate` is not performed manually, but from `crontab`... – Amadan Jun 22 '18 at 08:50
  • Thank you. It seems like, my misake. It may be no problem. sudo logrotate -f /etc/logrotate.d/systemname – mbt Jun 22 '18 at 09:00

1 Answers1

1

I am assuming that you tried to run logrotate as unprivileged user ($ in the prompt), so you had no permissions for /var/lib/logrotate/.

gbajson
  • 1,531
  • 13
  • 32