当前位置:网站首页>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
边栏推荐
- Facing the rebound market, how do we operate? 2020-03-21
- Rust语言- Slice(切片)类型(&[u8])
- [pytorch] fine tuning technology
- Go的map字典及约束
- Downloadutilse tool class without error
- [Web3 series development tutorial - create your first NFT (4)] what can NFTs bring to you
- [pytorch] picture enlargement
- Regular expressions and calling related functions in C language
- 堆排序(heap-sort)
- [C language] file operation
猜你喜欢

09 eth smart contract

Experimental flags: --disable_ admission_ control=false --enable_ rm=false --llama_ callback_ port=28000

Click "Niuke | daily question" to eliminate it

Press in and pop-up sequence of "Niuke | daily question" stack

Vision Transformer 必读系列之图像分类综述

Vim中删除^M

Can C use reflection to assign values to read-only attributes?

『HarmonyOS』探索HarmonyOS应用

Basis of multimodal semantic segmentation
![[1]数学建模基础入门知识](/img/29/90b1c7533e9443852758d10080e239.png)
[1]数学建模基础入门知识
随机推荐
Markdown add Emoji expression
供应链的多目标协同决策
【C语言】通讯录动态版和文件版
JS date details, string to date
MySQL Foundation (II) -- MySQL Foundation
Display Chinese characters in uitoolkit
Use and analysis of show profile optimized by MySQL
Downloadutilse tool class without error
[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming
Can C use reflection to assign values to read-only attributes?
Problems related to the use of ucharts (components) in uniapp
[untitled]
Resume considerations
How does the seckill system ensure that the database does not crash and prevent oversold goods
Database and the future of open source
Input the records of 5 students (each record includes student number and grade), form a record array, and then output them in order of grade from high to low The sorting method adopts selective sortin
Conda 虚拟环境envs目录为空
定义方法时为什么使用static关键字
Tiktok web s_ v_ web_ Analysis and implementation of ID parameter generation
Slice and array of go