You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
420 B
13 lines
420 B
#!/bin/bash
|
|
set -Eeuo pipefail
|
|
|
|
# Find the latest restore-ready backup archive
|
|
LATEST=$(ls -1t "${BACKUP_SOURCE}"/*.tar.gz 2>/dev/null | head -1 || true)
|
|
if [ -z "$LATEST" ]; then
|
|
echo "No backup archive found in ${BACKUP_SOURCE}, starting with a fresh database."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Restoring database from ${LATEST}..."
|
|
tar -xzf "${LATEST}" -C "${DB_DEST}"
|
|
echo "Restore completed. Database ready at ${DB_DEST}."
|
|
|