logrotate period

Syntax

logrotate period {daily | hourly | monthly | weekly} no logrotate period

描述

Sets the rotate period for the event logs, stored in the/var/log/event.logfile, and authentication logs, stored in the/var/log/auth.logfile. Defaults todaily.

A log file that exceeds either thelogrotate <MAX-SIZE>value or thelogrotate period(whichever happens first), triggers rotation for that log file.

The没有form of this command resets the log rotation period to the default.

Command context

config

Parameters

daily

Rotates log files on a daily basis (default) at 1:00 am local time.

hourly

每小时的旋转日志文件first second of the hour.

monthly

Rotates log files monthly on the first day of the month.

weekly

Rotates log files once a week on Sunday.

Authority

Administrators or local user group members with execution rights for this command.

Examples

switch(config)#logrotate period weekly