From c2e58c773e4f6da7d139d919809c52b147d1c02e Mon Sep 17 00:00:00 2001 From: Robin Speekenbrink Date: Thu, 24 May 2018 11:03:04 +0200 Subject: [PATCH] Faster exporting for innodb tables Since InnoDB is the standard, i'd like to add the option `--single-transaction --quick` to the mysqldump command. This should speed up larger database exports without tearing the environment up whilst doing so... (see https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction) Another way would be to allow for custom config to be loaded which inludes a optional `[mysqldump]` section... Another (even better perhaps) solution would be to have non-s3-backup command that utilizes the i.e. percona xtrabackup as the backup mechanism (and restore) but that changes from simple SQL backups to more advanced full database stuff... --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index 736b674..b8daf23 100755 --- a/functions +++ b/functions @@ -101,7 +101,7 @@ service_export() { [[ -n $SSH_TTY ]] && stty -opost docker exec "$SERVICE_NAME" bash -c "printf '[client]\npassword=$PASSWORD\n' > /root/credentials.cnf" - docker exec "$SERVICE_NAME" mysqldump --defaults-extra-file=/root/credentials.cnf --user=mysql "$DATABASE_NAME" + docker exec "$SERVICE_NAME" mysqldump --defaults-extra-file=/root/credentials.cnf --user=mysql --single-transaction --quick "$DATABASE_NAME" docker exec "$SERVICE_NAME" rm /root/credentials.cnf status=$? [[ -n $SSH_TTY ]] && stty opost