|
|
@ -2,9 +2,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
set -euxo pipefail;
|
|
|
|
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 |
|
|
|
|
pv --quiet --buffer-size 256M |
|
|
|
|
gpg --quiet --no-verbose --encrypt --recipient {{ backup_gpg_fingerprint | quote }} --trust-model always > "$file";
|
|
|
|
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";
|
|
|
|
chmod u+r-wx,g+r-wx,o+r-wx "$file";
|
|
|
|