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