From f3b80c920ff1ca8855702e6e6a372b8f4792d4e2 Mon Sep 17 00:00:00 2001 From: julien Date: Sun, 19 Jan 2025 15:46:44 +0100 Subject: [PATCH] use rsync instead scp --- sbin/vol-compress | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sbin/vol-compress b/sbin/vol-compress index 143893c..9bfc148 100644 --- a/sbin/vol-compress +++ b/sbin/vol-compress @@ -29,10 +29,17 @@ if [ -d "volumes/postgres" ]; then nerdctl exec -e $CONTAINER_NAME pg_dump -U $DB_USER $DB_NAME > volumes/$DUMP_NAME fi -# Compress all volumes excerpt mysql and postgres into the storage box (pubkey needed) +# Compress all volumes excerpt mysql and postgres BACKUP=${PWD##*/}.tar.zst tar --zstd -cf /tmp/$BACKUP -C volumes . -rm volumes/$DUMP_NAME + +# Put it into the storage box (pubkey needed) +STORAGE_BOX=u442569@u442569.your-storagebox.de TODAY=$(date +%F) -scp -r /tmp/$BACKUP u442569@u442569.your-storagebox.de:/$TODAY/$BACKUP +rsync -r /tmp/$BACKUP $STORAGE_BOX:/$TODAY/$BACKUP + +# Clean +if [ -f "volumes/$DUMP_NAME" ]; then + rm volumes/$DUMP_NAME +fi rm /tmp/$BACKUP