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
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).
-
-
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 -
-
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
-