File tree 4 files changed +11
-11
lines changed
4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ def backup_task(self):
50
50
for i in range (int (self .conf ['backup_interval' ]), 0 , - 1 ):
51
51
print (f'\r 下一次备份将在 { i } 秒后开始...' , end = '' )
52
52
time .sleep (1 )
53
- except FileNotFoundError as e :
54
- INFO .logger .error (f"备份失败,{ e } " )
55
- print (f"备份失败, { e } " )
53
+ except FileNotFoundError :
54
+ INFO .logger .error (f"备份失败,请检查config.ini中main_directory路径配置 " )
55
+ print (f"\r 备份失败,请检查config.ini中main_directory路径配置 " )
56
56
57
57
# 备份时间必须大于等于60秒
58
58
elif int (self .conf ['backup_interval' ]) < 60 :
Original file line number Diff line number Diff line change 1
1
[Settings]
2
- # *PalServer程序路径
3
- main_directory = D:\Steam \steamapps\common\PalServer
2
+ # 游戏主目录
3
+ main_directory = C:\Users\Administrator\Desktop\steamcmd \steamapps\common\PalServer
4
4
5
5
# 需要备份到的目录(为空的话则会默认在当前目录创建Backup存档目录)
6
- backup_dir =
6
+ backup_dir = C:\Users\Administrator\Desktop\steamcmd\steamapps\common\PalServer
7
7
8
- # 启动参数(从启动参数自定义端口和玩家数量,例如: arguments = -port=21424 -players=32)
9
- # 可以为空
8
+ # 启动参数可以为空(自定义端口和玩家数量,例如: arguments = -port=21424 -players=32)
10
9
arguments =
11
10
12
11
# 自定义服务器备份间隔必须 ≥ 1分钟
Original file line number Diff line number Diff line change 6
6
import json
7
7
import os
8
8
9
+
9
10
def read_config ():
10
11
# 读取配置文件
11
12
config = configparser .ConfigParser ()
Original file line number Diff line number Diff line change @@ -84,9 +84,9 @@ def start_program(self):
84
84
85
85
try :
86
86
subprocess .Popen (program_args )
87
- except FileNotFoundError as e :
88
- INFO .logger .error (f"[ 启动任务 ] 请检查config.ini配置路径,错误信息: { e } " )
89
- print (f"\r [ 启动任务 ] 请检查config.ini配置路径,错误信息: { e } " )
87
+ except FileNotFoundError :
88
+ INFO .logger .error (f"[ 启动任务 ] 启动失败, 请检查config.ini中main_directory路径配置 " )
89
+ print (f"\r [ 启动任务 ] 启动失败, 请检查config.ini中main_directory路径配置 " )
90
90
time .sleep (3 )
91
91
exit (1 )
92
92
You can’t perform that action at this time.
0 commit comments