From 313090bcf0f0fcea9d27bb27d478a237c955a7fc Mon Sep 17 00:00:00 2001 From: newtonne Date: Sun, 8 Jan 2017 23:21:54 +0000 Subject: [PATCH 1/4] --exclude-globbing-filelist is pending deprecation --- templates/duply.sh.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/duply.sh.j2 b/templates/duply.sh.j2 index b38e2c3..327d182 100755 --- a/templates/duply.sh.j2 +++ b/templates/duply.sh.j2 @@ -2138,20 +2138,20 @@ case "$(tolower $cmd)" in ( run_script "$script" ) ;; 'bkp') - duplify -- "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \ + duplify -- "${dupl_opts[@]}" --exclude-filelist "$EXCLUDE" \ "$SOURCE" "$BACKEND_URL" ;; 'incr') - duplify incr -- "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \ + duplify incr -- "${dupl_opts[@]}" --exclude-filelist "$EXCLUDE" \ "$SOURCE" "$BACKEND_URL" ;; 'full') - duplify full -- "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \ + duplify full -- "${dupl_opts[@]}" --exclude-filelist "$EXCLUDE" \ "$SOURCE" "$BACKEND_URL" ;; 'verify') TIME="${ftpl_pars[0]:+"-t ${ftpl_pars[0]}"}" - duplify verify -- $TIME "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \ + duplify verify -- $TIME "${dupl_opts[@]}" --exclude-filelist "$EXCLUDE" \ "$BACKEND_URL" "$SOURCE" ;; 'verifypath') @@ -2162,7 +2162,7 @@ case "$(tolower $cmd)" in Hint: Syntax is -> $ME verifyPath []" - duplify verify -- $TIME "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \ + duplify verify -- $TIME "${dupl_opts[@]}" --exclude-filelist "$EXCLUDE" \ --file-to-restore "$IN_PATH" "$BACKEND_URL" "$OUT_PATH" ;; 'list') From 5c61c1cbc3a6f5d5b80253d4ad3c92a2a19e922e Mon Sep 17 00:00:00 2001 From: Matias Date: Tue, 15 Aug 2017 12:35:31 +0300 Subject: [PATCH 2/4] add quotes to mysql password Passwords with special chars would break the script otherwise. --- templates/pre.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/pre.j2 b/templates/pre.j2 index 10ae897..306efe1 100644 --- a/templates/pre.j2 +++ b/templates/pre.j2 @@ -14,11 +14,11 @@ pg_dump -U {{backup_postgres_user}} {{ '-h ' + backup_postgres_host if backup_p {% if item.source == 'mysql://' %} # Dump all databases -mysqldump -u {{backup_mysql_user}} -p{{backup_mysql_pass}} --all-databases > ${WORKDIR}/dump +mysqldump -u {{backup_mysql_user}} -p'{{backup_mysql_pass}}' --all-databases > ${WORKDIR}/dump {% else %} # Dump the passed database DBNAME={{item.source.split('mysql://')[-1]}} -mysqldump -u {{backup_mysql_user}} -p{{backup_mysql_pass}} $DBNAME > ${WORKDIR}/dump +mysqldump -u {{backup_mysql_user}} -p'{{backup_mysql_pass}}' $DBNAME > ${WORKDIR}/dump {% endif %} {% elif item.source.startswith('mongo://') %} From 887a76e7c8bfddfb7ad3b42d8de83121fe97d8f5 Mon Sep 17 00:00:00 2001 From: Matias Date: Tue, 15 Aug 2017 15:47:07 +0300 Subject: [PATCH 3/4] Mysql user for every site --- templates/pre.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/pre.j2 b/templates/pre.j2 index 306efe1..2386192 100644 --- a/templates/pre.j2 +++ b/templates/pre.j2 @@ -14,11 +14,11 @@ pg_dump -U {{backup_postgres_user}} {{ '-h ' + backup_postgres_host if backup_p {% if item.source == 'mysql://' %} # Dump all databases -mysqldump -u {{backup_mysql_user}} -p'{{backup_mysql_pass}}' --all-databases > ${WORKDIR}/dump +mysqldump -u {{item.backup_mysql_user}} -p'{{item.backup_mysql_pass}}' --all-databases > ${WORKDIR}/dump {% else %} # Dump the passed database DBNAME={{item.source.split('mysql://')[-1]}} -mysqldump -u {{backup_mysql_user}} -p'{{backup_mysql_pass}}' $DBNAME > ${WORKDIR}/dump +mysqldump -u {{item.backup_mysql_user}} -p'{{item.backup_mysql_pass}}' $DBNAME > ${WORKDIR}/dump {% endif %} {% elif item.source.startswith('mongo://') %} From 57257eb4be3c5f9fbb63a67ba56eed014e15fdc1 Mon Sep 17 00:00:00 2001 From: Matias Date: Tue, 15 Aug 2017 16:06:47 +0300 Subject: [PATCH 4/4] Mysql user for every site in restore script --- templates/restore.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/restore.j2 b/templates/restore.j2 index a4477d3..2c161db 100644 --- a/templates/restore.j2 +++ b/templates/restore.j2 @@ -15,11 +15,11 @@ rm -rf $WORKDIR/dump {% if item.source == 'mysql://' %} # Restore all databases -mysql -u {{backup_mysql_user}} -p{{backup_mysql_pass}} < ${WORKDIR}/dump +mysql -u {{item.backup_mysql_user}} -p'{{item.backup_mysql_pass}}' < ${WORKDIR}/dump {% else %} # Restore the passed database DBNAME={{item.source.split('mysql://')[-1]}} -mysql -u {{backup_mysql_user}} -p{{backup_mysql_pass}} $DBNAME < ${WORKDIR}/dump +mysql -u {{item.backup_mysql_user}} -p'{{item.backup_mysql_pass}}' $DBNAME < ${WORKDIR}/dump rm -rf $WORKDIR/dump {% endif %}