什么是"每日" logrotate.conf中的关键字

时间:2016-01-13 08:22:33

标签: linux cron logrotate

我想每小时轮换一次日志,因此我将<div class="ui-grid-cell-contents"> <button type="button" class="btn btn-xs btn-primary" ng-click="grid.appScope.c.editRow(grid, row)"> <i class="fa fa-edit"></i> </button> </div> 文件放在logrotate目录中。此/etc/cron.hourly/文件中包含以下行。

logrotate

当我打开/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1 时,我发现配置文件包含/etc/logrotate.conf个关键字。

但是,每小时仍会调用daily(因为它位于cron.hourly目录中)。

所以,我的问题是如果使用logrotate每小时调用logrotate,那么在cron文件中使用daily的真正用途是什么?

1 个答案:

答案 0 :(得分:0)

它每小时被调用一次,24次中24次它什么都不做(因为它试图按天分割当前文件,并且所有文件都来自一天)。

如果您没有指定间隔,它会在每次运行时旋转文件(因此,每小时一次)。