日誌切割logrotate-Linux 原

日誌切割logrotate
配置文件位置:
/etc/logrotate.conf
/etc/logrotate.d/

舉例來說,如果我們想要每天切割access.log日誌,
則可以將如下配置放入到配置文件即可,此段配置表示
每天切割一次日誌,日誌最小要到5M時纔會切割(實操時,日誌沒有達到5M時也生成了新的日誌文件)保留7個日誌文件
/usr/local/openresty/nginx/logs/access.log{
    daily
    rotate 7
    minisize 5M
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章