Commit 7294aed0 authored by Mehdi Khadir's avatar Mehdi Khadir
Browse files

chore: can pass a db user as parameter

parent 2e5a546c
......@@ -4,6 +4,6 @@ when = everyday at {{ backup_app_service_conf_time | mandatory }}
cd {{ backup_prod_dir }}/{{ app_instance_id }}
rm {{ backup_prod_dir }}/{{ app_instance_id }}/{{ database_docker_name }}.sql
chmod 777 {{ backup_prod_dir }}/{{ app_instance_id }}
/usr/bin/docker run --rm --link {{ database_docker_name }}:db --net {{ database_docker_network }} -v {{ backup_prod_dir }}/{{ app_instance_id }}:/backup -e PGPASSWORD={{ database_password }} {{ postgres_docker_image }} pg_dumpall -h db -U postgres -f /backup/{{ database_docker_name }}_all.sql
/usr/bin/docker run --rm --link {{ database_docker_name }}:db --net {{ database_docker_network }} -v {{ backup_prod_dir }}/{{ app_instance_id }}:/backup -e PGPASSWORD={{ database_password }} {{ postgres_docker_image }} pg_dumpall -h db -U {{ database_user | default("postgres") }} -f /backup/{{ database_docker_name }}_all.sql
rc=$?; if [[ $rc != 0 ]]; then fatal "sql" ; fi
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment