From ee5b997d2ac0007ae3cb561747830227b962e60f Mon Sep 17 00:00:00 2001 From: julien Date: Sun, 19 Jan 2025 15:32:06 +0100 Subject: [PATCH] backups into a date named dir --- sbin/vol-compress | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/vol-compress b/sbin/vol-compress index a713179..584f605 100644 --- a/sbin/vol-compress +++ b/sbin/vol-compress @@ -28,7 +28,7 @@ if [ -d "volumes/postgres" ]; then DB_USER=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_USER"') DB_PASSWORD=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_PASSWORD"') DB_NAME=$(nerdctl exec $CONTAINER_NAME bash -c 'echo "$POSTGRES_DATABASE"') - DUMP_NAME=$CONTAINER_NAME_$(date +%F_%T).sql + DUMP_NAME=$CONTAINER_NAME if [ -f "volumes/*.sql" ]; then rm volumes/*.sql fi @@ -37,6 +37,7 @@ fi # Compress all volumes excerpt mysql and postgres into the storage box (pubkey needed) BACKUP=${PWD##*/}.tar.zst -tar --zstd -cf $BACKUP -C volumes /tmp -scp /tmp/$BACKUP u442569@u442569.your-storagebox.de +tar --zstd cf /tmp/$BACKUP -C volumes . +TODAY=$(date +%F) +scp -r /tmp/$BACKUP u442569@u442569.your-storagebox.de:$TODAY/$BACKUP rm /tmp/$BACKUP