2025-05-03 22:58:39 +12:00

24 lines
699 B
Bash

#!/bin/bash
source "${AGENT_PATH}/_common.sh" || _die "Failed to source _common.sh"
# Simple Object Storage Restore Script
# Restores data from a backup file.
_check_required_env_vars "CONTAINER_NAME" "VOLUME_NAME"
echo "Uninstalling service before restore..."
bash ./uninstall.sh || _die "Failed to uninstall service before restore"
echo "Restoring data for ${CONTAINER_NAME} from ${BACKUP_FILE}..."
if ! autorestore "volume=${VOLUME_NAME}" "$1" "$2"; then
_die "Failed to restore data from backup file"
fi
echo "Restore complete. Reinstalling service..."
bash ./install.sh || _die "Failed to reinstall service after restore"
echo "Service ${CONTAINER_NAME} restored and reinstalled."