use rsync instead scp

This commit is contained in:
julien 2025-01-19 15:46:44 +01:00
parent 3d071c9f0a
commit f3b80c920f

View File

@ -29,10 +29,17 @@ if [ -d "volumes/postgres" ]; then
nerdctl exec -e $CONTAINER_NAME pg_dump -U $DB_USER $DB_NAME > volumes/$DUMP_NAME nerdctl exec -e $CONTAINER_NAME pg_dump -U $DB_USER $DB_NAME > volumes/$DUMP_NAME
fi 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 BACKUP=${PWD##*/}.tar.zst
tar --zstd -cf /tmp/$BACKUP -C volumes . 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) 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 rm /tmp/$BACKUP