Logrotate cronjob没有运行

时间:2016-01-12 15:31:49

标签: linux logrotate

我希望使用以下命令作为cron作业:

/usr/sbin/logrotate /home/xxxx/public_html/cgi-bin/logrotate.conf -f

但是消息是:

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

有解决方法吗?

2 个答案:

答案 0 :(得分:2)

您可以指定状态文件的输出位置:

/usr/sbin/logrotate -s /home/xxxx/logrotate/logrotate.status /home/xxxx/public_html/cgi-bin/logrotate.conf -f

答案 1 :(得分:0)

尝试运行cron作为sudoer:

sudo /usr/sbin/logrotate /home/xxxx/public_html/cgi-bin/logrotate.conf -f

相关问题