Spaces:
Running
Running
Update sync_data.sh
Browse files- sync_data.sh +3 -1
sync_data.sh
CHANGED
|
@@ -60,6 +60,8 @@ with requests.get(f'$FULL_WEBDAV_URL/{latest_backup}', auth=('$WEBDAV_USERNAME',
|
|
| 60 |
os.makedirs('/data', exist_ok=True)
|
| 61 |
target_path = os.path.join('/data', 'cloudpaste.db')
|
| 62 |
os.replace(db_path, target_path)
|
|
|
|
|
|
|
| 63 |
print(f'成功从 {latest_backup} 恢复备份到 {target_path}')
|
| 64 |
break
|
| 65 |
else:
|
|
@@ -163,4 +165,4 @@ else:
|
|
| 163 |
}
|
| 164 |
|
| 165 |
# 后台启动同步进程
|
| 166 |
-
sync_data &
|
|
|
|
| 60 |
os.makedirs('/data', exist_ok=True)
|
| 61 |
target_path = os.path.join('/data', 'cloudpaste.db')
|
| 62 |
os.replace(db_path, target_path)
|
| 63 |
+
# 恢复后立刻确保可写,使用 0o666 保证在容器中任意运行用户都有写权限
|
| 64 |
+
os.chmod(target_path, 0o666)
|
| 65 |
print(f'成功从 {latest_backup} 恢复备份到 {target_path}')
|
| 66 |
break
|
| 67 |
else:
|
|
|
|
| 165 |
}
|
| 166 |
|
| 167 |
# 后台启动同步进程
|
| 168 |
+
sync_data &
|