While running the command /usr/sbin/logrotate /etc/logrotate.d/applogrotate. I get the error error: error setting owner of a.s to uid 0 and gid 0: Operation not permitted. Inside the applogratate file, I have written create 0664 root root which I think is the cause of the error. Can someone help with a resolution?

1 Answer 1


You need to run logrotate as root if you want to be able to create log files as root:

sudo logrotate /etc/logrotate.d/applogrotate

(assuming sudo is configured appropriately).

  • sudo /usr/sbin/logrotate /etc/logrotate.d/applogrotate? Jan 5 at 12:31
  • If you want, but you shouldn’t need to specify /usr/sbin because that’s on root’s path by default. Jan 5 at 12:34
  • Sure Thanks a lot. Will accept the answer Jan 5 at 12:38
  • Getting another error - error: skipping a.s because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation. Jan 5 at 12:40
  • Please help with this Jan 5 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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