Update sync.py
Browse files
sync.py
CHANGED
|
@@ -33,8 +33,13 @@ def backup():
|
|
| 33 |
return
|
| 34 |
|
| 35 |
with tarfile.open(FILENAME, "w:gz") as tar:
|
| 36 |
-
# 备份
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
# 上传并覆盖
|
| 40 |
api.upload_file(
|
|
|
|
| 33 |
return
|
| 34 |
|
| 35 |
with tarfile.open(FILENAME, "w:gz") as tar:
|
| 36 |
+
# 备份关键数据
|
| 37 |
+
# 备份 /root/.openclaw 下面全部文件和文件夹(修正嵌套问题)
|
| 38 |
+
for item in os.listdir("/root/.openclaw"):
|
| 39 |
+
p = os.path.join("/root/.openclaw", item)
|
| 40 |
+
if os.path.exists(p):
|
| 41 |
+
arcname = item
|
| 42 |
+
tar.add(p, arcname=arcname)
|
| 43 |
|
| 44 |
# 上传并覆盖
|
| 45 |
api.upload_file(
|