Skip to content

Commit

Permalink
compress only once and remove intermediary
Browse files Browse the repository at this point in the history
  • Loading branch information
eltorio committed Dec 16, 2023
1 parent 3836712 commit 596a9d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/autobackup
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
MAILUSER=`cat /app/zone-mta/config/builtin-zonemta.json |sed -n 's/^.*\"user\":.*\"\(.*\)\",$/\1/p'| head -n1`
MAILPASSWD=`cat /app/zone-mta/config/builtin-zonemta.json |sed -n 's/^.*\"pass\":.*\"\(.*\)\"$/\1/p'| head -n1`
NOW=`date -I`
/usr/bin/mysqldump -h $MYSQL_HOST --password="$MYSQL_ROOT_PASSWORD" --all-databases | xz -9 > /app/server/files/backup.sql.xz
tar -cvJf /app/server/files/backup.tar.xz /app/server/files/backup.sql.xz /app/server/files/campaign /app/server/files/certs /app/server/files/imports /app/server/files/reports /app/server/files/template /app/server/files/uploaded
/usr/bin/mysqldump -h $MYSQL_HOST --password="$MYSQL_ROOT_PASSWORD" --all-databases > /app/server/files/backup.sql
tar -cv /app/server/files/backup.sql /app/server/files/campaign /app/server/files/certs /app/server/files/imports /app/server/files/reports /app/server/files/template /app/server/files/uploaded | xz -9 > /app/server/files/backup.tar.xz
rm /app/server/files/backup.sql
(
cat << EOF
From: "SAUVEGARDE @HCFMailer+" <$BACKUP_FROM>
Expand Down

0 comments on commit 596a9d8

Please sign in to comment.