logrotate 小时
时间: 2023-10-27 15:21:57 浏览: 110
Logrotate实现Catalina.out日志每俩小时切割示例
Logrotate默认的规则是按天计算的,所以不能满足按小时切割日志文件的需求。[1]
为了实现按小时分割日志文件,可以通过cron计划任务来运行logrotate。系统会定时运行logrotate,一般是每天一次。
在服务器初始化的时候,logrotate通常已经存在,但为了保险起见,可以手动安装logrotate,使用命令yum -y install logrotate。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Logrotate 对服务器日志按照小时切割并压缩](https://blog.csdn.net/yizhiniu_xuyw/article/details/113807598)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Logrotate实现Catalina.out日志每俩小时切割示例](https://download.csdn.net/download/weixin_38629362/14091417)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文