Update sync_data.sh
Browse files- sync_data.sh +6 -3
sync_data.sh
CHANGED
|
@@ -111,7 +111,7 @@ try:
|
|
| 111 |
print(f'Successfully downloaded backup to temporary directory: {filepath}')
|
| 112 |
print(\"Before restoring backup:\")
|
| 113 |
import subprocess
|
| 114 |
-
subprocess.run(['ls', '-l', \"$CLOUDREVE_DIR\"], shell=True)
|
| 115 |
|
| 116 |
# 删除现有的 Cloudreve 目录和配置文件
|
| 117 |
import shutil
|
|
@@ -137,7 +137,7 @@ try:
|
|
| 137 |
print(f'Successfully restored backup from {latest_backup}')
|
| 138 |
|
| 139 |
print(\"After restoring backup:\")
|
| 140 |
-
subprocess.run(['ls', '-l', \"$CLOUDREVE_DIR\"], shell=True)
|
| 141 |
else:
|
| 142 |
print('Error during file download.')
|
| 143 |
|
|
@@ -175,7 +175,7 @@ sync_data() {
|
|
| 175 |
upload_backup "$backup_path" "${backup_file}"
|
| 176 |
|
| 177 |
rm -f "$backup_path"
|
| 178 |
-
else
|
| 179 |
echo "Cloudreve directory does not exist yet, waiting for next sync..."
|
| 180 |
fi
|
| 181 |
|
|
@@ -185,6 +185,9 @@ sync_data() {
|
|
| 185 |
done
|
| 186 |
}
|
| 187 |
|
|
|
|
|
|
|
|
|
|
| 188 |
# 后台启动同步进程
|
| 189 |
sync_data &
|
| 190 |
|
|
|
|
| 111 |
print(f'Successfully downloaded backup to temporary directory: {filepath}')
|
| 112 |
print(\"Before restoring backup:\")
|
| 113 |
import subprocess
|
| 114 |
+
subprocess.run(['ls', '-l', \"$CLOUDREVE_DIR\"], shell=True, check=False)
|
| 115 |
|
| 116 |
# 删除现有的 Cloudreve 目录和配置文件
|
| 117 |
import shutil
|
|
|
|
| 137 |
print(f'Successfully restored backup from {latest_backup}')
|
| 138 |
|
| 139 |
print(\"After restoring backup:\")
|
| 140 |
+
subprocess.run(['ls', '-l', \"$CLOUDREVE_DIR\"], shell=True, check=False)
|
| 141 |
else:
|
| 142 |
print('Error during file download.')
|
| 143 |
|
|
|
|
| 175 |
upload_backup "$backup_path" "${backup_file}"
|
| 176 |
|
| 177 |
rm -f "$backup_path"
|
| 178 |
+
else
|
| 179 |
echo "Cloudreve directory does not exist yet, waiting for next sync..."
|
| 180 |
fi
|
| 181 |
|
|
|
|
| 185 |
done
|
| 186 |
}
|
| 187 |
|
| 188 |
+
# 延迟启动同步脚本,给 Cloudreve 一些启动时间
|
| 189 |
+
sleep 10
|
| 190 |
+
|
| 191 |
# 后台启动同步进程
|
| 192 |
sync_data &
|
| 193 |
|