vendor/Stouts.backup/templates/pre.j2 in taperole-1.6.0 vs vendor/Stouts.backup/templates/pre.j2 in taperole-1.7.0
- old
+ new
@@ -10,11 +10,17 @@
DBNAME={{item.source.split('postgresql://')[-1]}}
pg_dump -U {{backup_postgres_user}} {{ '-h ' + backup_postgres_host if backup_postgres_host else ''}} {{ ('-p %s' % backup_postgres_port) if backup_postgres_port else ''}} -c $DBNAME -f ${WORKDIR}/dump
{% elif item.source.startswith('mysql://') %}
+{% if item.source == 'mysql://' %}
+# Dump all databases
+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
+{% endif %}
{% elif item.source.startswith('mongo://') %}
mongodump --out $WORKDIR/dump