@@ -2,14 +2,26 @@ log_retention.sh文件使用说明:
2
2
3
3
1. 执行该文件之前,需要使用'chmod +x'命令给该文件添加执行权限。
4
4
2. 该程序须自定义参数来执行自定义日志保留计划,可以在config.json定义相关参数。
5
- 3. 相关参数设定可使用 'man logrotate'查询
5
+ 3. 该程序有清理日志,与日志轮转两种模式,可以通过cnofig文件的clean参数来选择。
6
+ 4. 其余日志轮转相关参数设定可使用 'man logrotate'查询。
7
+ 5. 清理日志模式,是一次性操作,会删除所有日志压缩文件。
8
+ 成功执行的结果为:Clean all .gz files in $folder。
9
+ 6. 日志轮转模式,是logrotate自动执行的周期性操作,会根据设定的参数,将日志文件进行压缩。
10
+ 成功执行的结果为:Logrotate started successfully.
6
11
7
- 提示:此命令须在工作节点上以root权限执行,用于压缩或删除curve工作日志。
12
+
13
+ 提示:此命令须在每个工作节点上以root权限执行,用于压缩或删除curve工作日志。
8
14
#######################################################################
9
15
Instructions for using log_retention.sh file:
10
16
11
17
1. Before executing the file, you need to use the 'chmod +x' command to add execution permissions to the file.
12
18
2. The program requires customized parameters to execute a customized log retention plan. Relevant parameters can be defined in config.json.
13
- 3. Relevant parameter settings can be queried using 'man logrotate'
19
+ 3. This program has two modes: log cleaning and log rotation, which can be selected through the clean parameter of the cnofig file.
20
+ 4. The remaining log rotation related parameter settings can be queried using 'man logrotate'.
21
+ 5. Clean log mode is a one-time operation and will delete all compressed log files.
22
+ The result of successful execution is: Clean all .gz files in $folder.
23
+ 6. Log rotation mode is a periodic operation automatically performed by logrotate. It will compress log files according to the set parameters.
24
+ The result of successful execution is: Logrotate started successfully.
25
+
14
26
15
- Tip: This command must be executed with root privileges on the working node to compress or delete the curve working log.
27
+ Tip: This command must be executed with root privileges on each working node to compress or delete the curve working log.
0 commit comments