Update sync_data.sh
Browse files- sync_data.sh +5 -5
sync_data.sh
CHANGED
|
@@ -73,10 +73,10 @@ except Exception as e:
|
|
| 73 |
|
| 74 |
if os.path.exists(backup_file_path):
|
| 75 |
if os.path.exists(CLOUDREVE_DATA_DIR):
|
| 76 |
-
|
| 77 |
shutil.rmtree(CLOUDREVE_DATA_DIR)
|
| 78 |
os.makedirs(CLOUDREVE_DATA_DIR, exist_ok=True)
|
| 79 |
-
|
| 80 |
try:
|
| 81 |
with tarfile.open(backup_file_path, 'r:gz') as tar:
|
| 82 |
tar.extractall(CLOUDREVE_DATA_DIR)
|
|
@@ -96,8 +96,8 @@ restore_backup
|
|
| 96 |
# 等待30秒后启动程序
|
| 97 |
sleep 30
|
| 98 |
|
| 99 |
-
# 启动程序 (
|
| 100 |
-
./
|
| 101 |
|
| 102 |
# 同步函数
|
| 103 |
sync_data() {
|
|
@@ -156,7 +156,7 @@ except Exception as e:
|
|
| 156 |
print(f'Error managing backups: {e}')
|
| 157 |
"
|
| 158 |
rm -f "${backup_file_path}"
|
| 159 |
-
else
|
| 160 |
echo "Failed to create backup archive."
|
| 161 |
fi
|
| 162 |
|
|
|
|
| 73 |
|
| 74 |
if os.path.exists(backup_file_path):
|
| 75 |
if os.path.exists(CLOUDREVE_DATA_DIR):
|
| 76 |
+
print(f"Deleting existing data directory: $CLOUDREVE_DATA_DIR")
|
| 77 |
shutil.rmtree(CLOUDREVE_DATA_DIR)
|
| 78 |
os.makedirs(CLOUDREVE_DATA_DIR, exist_ok=True)
|
| 79 |
+
print(f"Extracting backup to: $CLOUDREVE_DATA_DIR")
|
| 80 |
try:
|
| 81 |
with tarfile.open(backup_file_path, 'r:gz') as tar:
|
| 82 |
tar.extractall(CLOUDREVE_DATA_DIR)
|
|
|
|
| 96 |
# 等待30秒后启动程序
|
| 97 |
sleep 30
|
| 98 |
|
| 99 |
+
# 启动程序 (根据您的日志,您运行的是 Cloudreve)
|
| 100 |
+
./cloudreve -c /opt/cloudreve/conf/cloudreve.ini &
|
| 101 |
|
| 102 |
# 同步函数
|
| 103 |
sync_data() {
|
|
|
|
| 156 |
print(f'Error managing backups: {e}')
|
| 157 |
"
|
| 158 |
rm -f "${backup_file_path}"
|
| 159 |
+
else
|
| 160 |
echo "Failed to create backup archive."
|
| 161 |
fi
|
| 162 |
|