日志轮换计划任务未运行

3

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

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

然而,这个信息是:
error: error creating state file /var/lib/logrotate.status: Permission
denied

有什么办法可以解决这个问题吗?

你是以非root用户身份执行此命令吗? - Pawan
2个回答

2

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

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

0

尝试以超级用户权限运行 cron:

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接