From 575deff1d29b87172fea2b7863b19ceaafaaff4f Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 19 Dec 2023 09:53:29 -0500 Subject: [PATCH] Starting of zfs storage volume-based backups. --- deployment/down.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/deployment/down.sh b/deployment/down.sh index a891e62..d9c324a 100755 --- a/deployment/down.sh +++ b/deployment/down.sh @@ -115,6 +115,26 @@ for VIRTUAL_MACHINE in $SERVERS; do fi done + +BACKUP_WWW_APPS=true +echo "BACKUP_WWW_APPS: $BACKUP_WWW_APPS" + + +echo "SERVERS: $SERVERS" +echo "BACKUP_WWW_APPS: $BACKUP_WWW_APPS" + + +# let's grab a snapshot of the +if [ "$BACKUP_WWW_APPS" = true ]; then + #SNAPSHOT_ID=$(cat /dev/urandom | tr -dc 'a-aA-Z' | fold -w 6 | head -n 1) + #incus storage volume snapshot create ss-base www-ss-data "$SNAPSHOT_ID" + BACKUP_LOCATION="$HOME/ss/backups" + mkdir -p "$BACKUP_LOCATION" + incus storage volume export ss-base "www-ss-data" "$BACKUP_LOCATION/project-$(incus project list --format csv | grep "(current)" | awk '{print $1}')_www-ss-data_""$(date +%s)"".tar.gz" + #incus storage volume snapshot delete ss-base "www-ss-data" "$SNAPSHOT_ID" +fi + + if incus network list -q | grep -q ss-ovn; then incus network delete ss-ovn fi