当前位置:网站首页>Log rotation logrotate
Log rotation logrotate
2022-07-26 06:43:00 【Hejing_ zhang】
log rotation logrotate
1. The configuration file :
- /etc/logrotate.conf # Master profile
- /etc/logrotate.d # The files in the changed directory will be read /etc/logrotate.conf, If the files in this directory do not define special parameters , With /etc/logrotate.conf The setting in the file is taken as the default
2. The flow chart is as follows :

- First execution rotate after , The original messages become messages.1, And it will make a new one messages To store log files
- Second execution ,messages.1 become messages.2,messages become messages.1, Create another one messages
- Third execution ,messages.2 become messages.3,messages.1 become messages.2,messages become messages.1, Create a new messages, Now there are four logs
- The fourth execution ,messages.3 become messages.4,messages.2 become messages.3,messages.1 become messages.2,messages become messages.1, Create a new messages. Now there is
messages.4、messages.3、messages.2、messages.1、messages, Delete messages.4 rotate The numerical value represents the last archived file , Namely xxx.tar.gz file
3. Profile parameter explanation
weekly:rotate cycle
rotate: Number of archives retained
create: The original log file is archived , To create a new log file to store logs
dateext: End with date
compress: Whether to compress when archiving
size: If you set 100K, The trigger condition is that as long as the log size reaches this value, it will be archived
minsize: If you set 100K, The trigger condition is that the size is greater than 100K And the cycle is
maxsize: If you set 100K, The trigger condition is that the cycle is up or the size is satisfied
边栏推荐
- IP day 10 notes - BGP
- Merge_sort
- UIToolkit工具模板工程
- vulnhub Lampião: 1
- Alibaba cloud OSS binding custom domain name
- [graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming
- Experimental flags: --disable_ admission_ control=false --enable_ rm=false --llama_ callback_ port=28000
- The creation of "harmonyos" project and the use of virtual machines
- Vim中删除^M
- @ConstructorProperties注解理解以及其对应使用方式
猜你喜欢

IP day 10 notes - BGP
![[C language] file operation](/img/19/5bfcbc0dc63d68f10155e16d99581c.png)
[C language] file operation

@ConstructorProperties注解理解以及其对应使用方式

日志轮转logrotate

Slice and array of go

"Niuke | daily question" template stack

Upgrade appium automation framework to the latest 2.0

Show you the principle of IO multiplexing (select, poll and epoll)
![[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming](/img/04/3121514fcd8fcf1c939cbca7f4c67a.jpg)
[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming

UIToolkit工具模板工程
随机推荐
FastDFS-支持双IP、IPV6
What are the aspects of performance testing? What are the classification and testing methods?
Uitoolkit tool template project
Facing the rebound market, how do we operate? 2020-03-21
『HarmonyOS』DevEco的下载安装与开发环境搭建
Basis of multimodal semantic segmentation
力扣5: 最长回文子串
CS5801_HDMI转EDP优势替代LT6711A方案
【无标题】
『HarmonyOS』工程的创建与虚拟机的使用
28. Implement strStr()实现 strStr()
Use and analysis of show profile optimized by MySQL
原生高性能抓包工具Proxyman,送给爱学习的你
Slice and array of go
Map collection inheritance structure
BigDecimal变为负数
使用Scanner从键盘获取多种数据类型
Go 的切片与数组
[fault diagnosis] bearing fault diagnosis based on Bayesian optimization support vector machine with matlab code
The real epidemic situation in the United States, do not easily "bottom" 2020-03-23