Spaces:
Running
Running
Update sync_data.sh
Browse files- sync_data.sh +2 -0
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:
|
|
|
|
| 60 |
os.makedirs('/data', exist_ok=True)
|
| 61 |
target_path = os.path.join('/data', 'cloudpaste.db')
|
| 62 |
os.replace(db_path, target_path)
|
| 63 |
+
# 恢复后立刻确保可写
|
| 64 |
+
os.chmod(target_path, 0o664)
|
| 65 |
print(f'成功从 {latest_backup} 恢复备份到 {target_path}')
|
| 66 |
break
|
| 67 |
else:
|