*/5 * * * * /usr/sbin/logrotate /etc/logrotate.d/腳本名
/etc/logrotate.d/腳本名
檔案具體路徑
{
rotate 4 #儲存檔案的個數
copytruncate #用于還在打開中的日志檔案,把目前日志備份并截斷
olddir #定義了舊的日志存儲在哪裡
missingok #如果上述news.crit檔案找不到的話也不報錯,直接跳過
nocompress #對輪轉後的檔案進行壓縮
create 0664 root utmp #建立檔案的權限
minsize 1M
dateext #使用當期日期作為命名格式
#dateformat .%Y-%m-%d #指定生成檔案的日期格式
}