Update server.py
Browse files
server.py
CHANGED
|
@@ -176,14 +176,15 @@ def compress_folder():
|
|
| 176 |
print('开始压缩数据')
|
| 177 |
result = subprocess.run(['7z', 'a', '-tzip', '-mx=1','-mmt=2', zip_file_path, data_folder])
|
| 178 |
print('重命名压缩后的文件')
|
| 179 |
-
|
|
|
|
| 180 |
if result.returncode != 0:
|
| 181 |
print("压缩失败,请检查7z命令是否正确")
|
| 182 |
return
|
| 183 |
|
| 184 |
-
print(f"Data compressed into {
|
| 185 |
|
| 186 |
-
file_size = os.path.getsize(
|
| 187 |
print('文件大小:', file_size, '上次文件大小:', last_uploaded_size)
|
| 188 |
|
| 189 |
# 判断是否大于800MB (800MB = 800 * 1024 * 1024 字节)
|
|
@@ -403,9 +404,10 @@ def SillyTavern():
|
|
| 403 |
|
| 404 |
# threading.Thread(target=SillyTavern, daemon=True).start()
|
| 405 |
# check_api1()
|
| 406 |
-
threading.Thread(target=repeat_task, daemon=True).start() #压缩备份
|
| 407 |
-
print("开始衔接")
|
| 408 |
-
Service_status = True
|
| 409 |
-
frp(config_data2,'/content/frp/frpc2.ini',True)
|
| 410 |
-
frp(config_data,'/content/frp/frpc.ini',False)
|
| 411 |
|
|
|
|
|
|
| 176 |
print('开始压缩数据')
|
| 177 |
result = subprocess.run(['7z', 'a', '-tzip', '-mx=1','-mmt=2', zip_file_path, data_folder])
|
| 178 |
print('重命名压缩后的文件')
|
| 179 |
+
file_path = '/a/sillytavern.zip1'
|
| 180 |
+
subprocess.run(['mv', zip_file_path,file_path])
|
| 181 |
if result.returncode != 0:
|
| 182 |
print("压缩失败,请检查7z命令是否正确")
|
| 183 |
return
|
| 184 |
|
| 185 |
+
print(f"Data compressed into {file_path}")
|
| 186 |
|
| 187 |
+
file_size = os.path.getsize(file_path) # 获取压缩包的大小
|
| 188 |
print('文件大小:', file_size, '上次文件大小:', last_uploaded_size)
|
| 189 |
|
| 190 |
# 判断是否大于800MB (800MB = 800 * 1024 * 1024 字节)
|
|
|
|
| 404 |
|
| 405 |
# threading.Thread(target=SillyTavern, daemon=True).start()
|
| 406 |
# check_api1()
|
| 407 |
+
# threading.Thread(target=repeat_task, daemon=True).start() #压缩备份
|
| 408 |
+
# print("开始衔接")
|
| 409 |
+
# Service_status = True
|
| 410 |
+
# frp(config_data2,'/content/frp/frpc2.ini',True)
|
| 411 |
+
# frp(config_data,'/content/frp/frpc.ini',False)
|
| 412 |
|
| 413 |
+
compress_folder()
|