main 程序添加启动调度器

This commit is contained in:
panjunlan
2026-02-22 15:44:10 +08:00
parent 375a54187d
commit e8ed320193
2 changed files with 43 additions and 16 deletions

View File

@@ -512,9 +512,9 @@ root 17 11 0 15:15 pts/1 00:00:00 ps -ef
### 修改代码进行临时测试
- 修改 config.yaml 文件
- ==snapshot_retention_days: 0== :定义删除多少天前的快照
- ==schedule==schedule 自定义改参数下定义的时间
- 修改 ==config.yaml== 文件
- `snapshot_retention_days: 0` :定义删除多少天前的快照
- `schedule`自定义改参数下的时间
``` yaml
@@ -536,15 +536,15 @@ global:
# 定时任务配置
schedule:
export: # 导出 Excel 和 Yaml 文件的时间
day_of_week: 'sat' # 星期几mon,tue,wed,thu,fri,sat,sun
hour: 6 # 小时 (0-23)
minute: 0 # 分钟 (0-59)
day_of_week: 'sun' # 星期几mon,tue,wed,thu,fri,sat,sun
hour: 15 # 小时 (0-23)
minute: 35 # 分钟 (0-59)
second: 0 # 秒 (可选)
delete: # 删除快照的时间
day_of_week: 'sat'
hour: 19
minute: 0
day_of_week: 'sun'
hour: 15
minute: 40
second: 0
EOF
@@ -567,7 +567,7 @@ EOF
#### 进入容器测试
手动执行 ==main.py== 运行
手动执行 `main.py` 运行
``` shell
[junlan@localhost removeweeklysnapshot]$ sudo docker exec -it removeweeklysnapshot bash