logrotate 管理日志文件不生效

tomcat日志过大,准备使用logrotate切割,配置如下
文件名为tomcat

/Tomcat/logs/catalina.out{
    copytruncate
    daily
    rotate 5
    missingok
    compress
}

将此文件放入/etc/logrotate.d/目录下
手动执行logrotate -d -f tomcat
只显示执行过程,却没有新的日志文件产生

第二天想再试试为什么没有生效
把命令记错了 logrotate -v -f tomcat
竟然成功了

真是手残

-d, --debug
Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file.

In debug mode, no changes will be made to the logs or to the logrotate state file.
In debug mode, no changes will be made to the logs or to the logrotate state file.
In debug mode, no changes will be made to the logs or to the logrotate state file.

你可能感兴趣的:(Linux,logrotate不生效)