You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
947 B
23 lines
947 B
#!/bin/bash -e
|
|
|
|
{% if documize_db_engine == 'mysql' %}
|
|
/usr/bin/mysqldump \
|
|
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
|
|
--user={{ documize_db_user | quote }} \
|
|
--password={{ documize_db_pass | quote }} \
|
|
--host={{ documize_db_server | quote }} \
|
|
{% endif %}
|
|
--quick --single-transaction \
|
|
--add-drop-table {{ documize_db_name | quote }} | zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
|
|
{% elif documize_db_engine == 'postgres' %}
|
|
{% if documize_db_server not in ['127.0.0.1','localhost'] %}
|
|
PGPASSWORD='{{ documize_db_pass }}' /usr/pgsql-13/bin/pg_dump \
|
|
--clean \
|
|
--username={{ documize_db_user | quote }} \
|
|
--host={{ documize_db_server | quote }} \
|
|
{{ documize_db_name | quote }} | \
|
|
{% else %}
|
|
su - postgres -c "/usr/pgsql-13/bin/pg_dump --clean {{ documize_db_name | quote }}" | \
|
|
{% endif %}
|
|
zstd -c > "{{ documize_root_dir }}/backup/{{ documize_db_name }}.sql.zst"
|
|
{% endif %}
|
|
|