【发布时间】:2018-04-14 10:24:52
【问题描述】:
有没有办法使用 logrotate 我可以旋转整个目录并压缩它,而不仅仅是特定目录中的文件?我尝试使用下面的配置进行试验,但这不起作用。在下面给出错误信息:
配置:
/path/to/folder/test {
daily
rotate 5
missingok
compress
delaycompress
}
错误:
$logrotate -vf test.conf
reading config file test.conf
reading config info for /path/to/folder/test
Handling 1 logs
rotating pattern: /path/to/folder/test forced from command line (5
rotations)
empty log files are rotated, old logs are removed
error: error creating unique temp file: Permission denied
【问题讨论】:
-
也许您只是想要一个压缩目录的每日 cron 作业?我不认为 logrotate 可以处理目录。
-
感谢您的建议,我尝试查找和试验,但无法正常工作。在得出结论之前,如果我误解或尝试了一些不正确的事情,我想与人们联系。