common: backup_mysql_database: Adapted script to structure of backup_files

dehydrated
Felix Stupp 5 years ago
parent 63e0a85dc0
commit c959db1d3f
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -2,9 +2,14 @@
set -euxo pipefail;
file={{ backups_mysql_database_directory | quote }}"/$1.sql.gpg";
# Arguments
db="$1";
mysqldump --opt --databases "$1" |
# Variables
file={{ backups_mysql_database_directory | quote }}"/$db.sql.gpg";
# Execution
mysqldump --opt --databases "$db" |
pv --quiet --buffer-size 256M |
gpg --quiet --no-verbose --encrypt --recipient {{ backup_gpg_fingerprint | quote }} --trust-model always > "$file";
chmod u+r-wx,g+r-wx,o+r-wx "$file";

Loading…
Cancel
Save