linux - Logrotate cronjob 未运行

标签 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

有解决办法吗?

最佳答案

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

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

关于linux - Logrotate cronjob 未运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34747643/

相关文章:

linux - 如何编写和执行将创建目录和 .txt 文件的脚本

c - Raspberry PI,如何配置其他 GPIO 作为 I2C 工作

linux - 安装 dsc21 时出错 : "dsc21 : Depends: cassandra (= 2.1.8) but 2.2.0 is to be installed"

linux - 如何每天轮换日志,仅使用当天的数据?

linux - logrotate配置文件开发与测试

linux - logrotate 不压缩

php - 仅使用 CentOS 安全设置的本地域上的 file_get_contents() 安全问题

.net - 如何从源代码安装 MonoDevelop 2.4?

python - 在 Windows 上,如何打开以写入另一个进程已打开以进行写入的文件?

docker - 如何禁用所有 docker 容器 JSON 日志?