This commit is contained in:
Your Name
2025-04-21 09:58:37 +12:00
parent 9e5a54ff36
commit 093dee3fd3
14 changed files with 577 additions and 36 deletions

24
templates/squashkiwi/backup.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Source common functions
source "$(dirname "$0")/_common.sh"
# Load environment variables
load_env "$1" || die "Failed to load environment variables"
# set the backup file name to be the current date and time
BACKUP_FILE="$BACKUP_FOLDER/backup-squashkiwi-$(date +%Y-%m-%d_%H-%M-%S).tar.gz"
if [ -f "$BACKUP_FILE" ]; then
echo "Backup file $BACKUP_FILE already exists"
exit 1
fi
stop_container
# create the backup file, using relative paths.
tar zcvf "$BACKUP_FILE" -C "$DATA_FOLDER" . || die "Failed to create backup"
start_container
echo "Backup created in $BACKUP_FILE"