Update sync_data.sh
Browse files72 unmodified lines7374757677787980818213 unmodified lines9697989910010110210352 unmodified lines15615715815916016116272 unmodified linesif os.path.exists(backup_file_path):if os.path.exists(CLOUDREVE_DATA_DIR):echo "Deleting existing data directory: $CLOUDREVE_DATA_DIR"shutil.rmtree(CLOUDREVE_DATA_DIR)os.makedirs(CLOUDREVE_DATA_DIR, exist_ok=True)echo "Extracting backup to: $CLOUDREVE_DATA_DIR"try:with tarfile.open(backup_file_path, 'r:gz') as tar:tar.extractall(CLOUDREVE_DATA_DIR)13 unmodified lines# 等待30秒后启动程序sleep 30# 启动程序 (假设您的主程序可执行文件名为 app)./app server &# 同步函数sync_data() {52 unmodified linesprint(f'Error managing backups: {e}')"rm -f "${backup_file_path}"else:echo "Failed to create backup archive."fi72 unmodified lines7374757677787980818213 unmodified lines9697989910010110210352 unmodified lines15615715815916016116272 unmodified linesif os.path.exists(backup_file_path):if os.path.exists(CLOUDREVE_DATA_DIR):print(f"Deleting existing data directory: $CLOUDREVE_DATA_DIR")shutil.rmtree(CLOUDREVE_DATA_DIR)os.makedirs(CLOUDREVE_DATA_DIR, exist_ok=True)print(f"Extracting backup to: $CLOUDREVE_DATA_DIR")try:with tarfile.open(backup_file_path, 'r:gz') as tar:tar.extractall(CLOUDREVE_DATA_DIR)13 unmodified lines# 等待30秒后启动程序sleep 30# 启动程序 (根据您的日志,您运行的是 Cloudreve)./cloudreve -c /opt/cloudreve/conf/cloudreve.ini &# 同步函数sync_data() {52 unmodified linesprint(f'Error managing backups: {e}')"rm -f "${backup_file_path}"elseecho "Failed to create backup archive."fi
sync_data.sh+5-5