
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 26s
26 lines
861 B
Bash
Executable File
26 lines
861 B
Bash
Executable File
#!/bin/bash
|
|
# shellcheck disable=SC1091
|
|
source "${AGENT_PATH}/common.sh" || _die "Failed to source common.sh"
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/_volumes.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}..."
|
|
|
|
# shellcheck disable=SC2046
|
|
restore_items $(get_simple_object_server_volumes) || _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."
|