sharween commited on
Commit
0f45aa5
·
verified ·
1 Parent(s): b9e43cd

Update sync.py

Browse files
Files changed (1) hide show
  1. sync.py +7 -2
sync.py CHANGED
@@ -33,8 +33,13 @@ def backup():
33
  return
34
 
35
  with tarfile.open(FILENAME, "w:gz") as tar:
36
- # 备份 /root/.openclaw 下面全部文件和文件夹(不带外层 .openclaw 目录)
37
- tar.add("/root/.openclaw", arcname="")
 
 
 
 
 
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(