Skip to content

Commit

Permalink
Don't write backupfile to disk before compressing
Browse files Browse the repository at this point in the history
  • Loading branch information
baszoetekouw committed Dec 12, 2024
1 parent 4455835 commit 702a30b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions roles/sbs/templates/backup-database.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -e

if [ $UID -ne 0 ]
then
echo "Sorry, this script must run as root"
exit 1
echo "Sorry, this script must run as root"
exit 1
fi

BACKUP_DIR="{{sbs_backup_dir}}"
Expand All @@ -24,7 +24,6 @@ mysqldump --host="{{ sbs_db_host }}" \
--no-tablespaces \
--disable-keys --extended-insert \
--databases "{{ sbs_db_name }}" \
> "${BACKUP_FILE}"
zstd -qq --rm "${BACKUP_FILE}"
| zstd -qq -o "${BACKUP_FILE}.zst"

exit 0

0 comments on commit 702a30b

Please sign in to comment.