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