Dropshell basic templates (WIP)
This commit is contained in:
21
simple-object-storage/restore.sh
Normal file
21
simple-object-storage/restore.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
source "${AGENT_PATH}/_common.sh" || _die "Failed to source _common.sh"
|
||||
_check_required_env_vars "BACKUP_FILE" "TEMP_DIR" "VOLUME_NAME" "CONTAINER_NAME"
|
||||
|
||||
# Simple Object Storage Restore Script
|
||||
# Restores data from a backup file.
|
||||
|
||||
|
||||
|
||||
echo "Uninstalling service before restore..."
|
||||
bash ./uninstall.sh || _die "Failed to uninstall service before restore"
|
||||
|
||||
echo "Restoring data for ${CONTAINER_NAME} from ${BACKUP_FILE}..."
|
||||
|
||||
autorestore "volume=${VOLUME_NAME}" || _die "Failed to restore data from backup file"
|
||||
|
||||
echo "Restore complete. Reinstalling service..."
|
||||
|
||||
bash ./install.sh || _die "Failed to reinstall service after restore"
|
||||
|
||||
echo "Service ${CONTAINER_NAME} restored and reinstalled."
|
Reference in New Issue
Block a user