是否有可能手动运行logrotate的一次迭代,而不将其安排在某个间隔上?


当前回答

运行所有logrotate的方法是:

logrotate -f /etc/logrotate.conf

这将运行主日志文件,其中还包括其他日志配置

其他回答

您可能希望在verbose + force模式下运行它。

Logrotate -vf /etc/logrotate.conf

是:logrotate——force $CONFIG_FILE

Logrotate -d [your_config_file]调用调试模式,为您详细描述将发生什么,但保持日志文件不变。

编辑/var/lib/logrotate.状态(或/var/lib/loglogrotate/logrotate.status)重置要测试的日志文件上的“上次旋转”日期。

然后执行logrotate YOUR_CONFIG_FILE命令。

或者你可以使用——force标志,但是编辑logrotate。状态可以让您更精确地确定哪些可以旋转,哪些不可以旋转。

运行所有logrotate的方法是:

logrotate -f /etc/logrotate.conf

这将运行主日志文件,其中还包括其他日志配置