|
|
@ -31,20 +31,29 @@ do |
|
|
|
{% else %} |
|
|
|
{% else %} |
|
|
|
{% set comp_ext = 'z' %} |
|
|
|
{% set comp_ext = 'z' %} |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
echo "Dumping $DB to $DEST/$DB.{{ dump_ext }}.{{ comp_ext }}" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump {{ dump_options }} $DB" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/$DB.{{ dump_ext }}.{{ comp_ext }} |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump {{ dump_options }} $DB" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/$DB.{{ dump_ext }}.{{ comp_ext }} |
|
|
|
|
|
|
|
echo "Dumping $DB schema to $DEST/$DB.schema.{{ dump_ext }}.{{ comp_ext }}" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump --schema-only -Fp $DB" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/$DB.schema.{{ dump_ext }}.{{ comp_ext }} |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump --schema-only -Fp $DB" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/$DB.schema.{{ dump_ext }}.{{ comp_ext }} |
|
|
|
{% else %} |
|
|
|
{% else %} |
|
|
|
|
|
|
|
echo "Dumping $DB to $DEST/$DB.{{ dump_ext }}" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump {{ dump_options }} $DB" > $DEST/$DB.{{ dump_ext }} |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump {{ dump_options }} $DB" > $DEST/$DB.{{ dump_ext }} |
|
|
|
|
|
|
|
echo "Dumping $DB schema to $DEST/$DB.schema.sql" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump --schema-only -Fp $DB" > $DEST/$DB.schema.sql |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dump --schema-only -Fp $DB" > $DEST/$DB.schema.sql |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
done |
|
|
|
done |
|
|
|
{% if pg_compress_cmd %} |
|
|
|
{% if pg_compress_cmd %} |
|
|
|
|
|
|
|
echo "Dumping globals to $DEST/pg_globals.sql.{{ comp_ext }}" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --globals-only" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/pg_globals.sql.{{ comp_ext }} |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --globals-only" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/pg_globals.sql.{{ comp_ext }} |
|
|
|
|
|
|
|
echo "Dumping all schemas to $DEST/pg_schema.sql.{{ comp_ext }}" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --schema-only" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/pg_schema.sql.{{ comp_ext }} |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --schema-only" | /bin/nice -n 10 {{ pg_compress_cmd }} > $DEST/pg_schema.sql.{{ comp_ext }} |
|
|
|
{% else %} |
|
|
|
{% else %} |
|
|
|
|
|
|
|
echo "Dumping globals to $DEST/pg_globals.sql" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --globals-only" > $DEST/pg_globals.sql |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --globals-only" > $DEST/pg_globals.sql |
|
|
|
|
|
|
|
echo "Dumping all schemas to $DEST/pg_schema.sql" |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --schema-only" > $DEST/pg_schema.sql |
|
|
|
su - postgres -c "{{ (pg_version != 'default') | ternary('/usr/pgsql-' + pg_version | string,'') }}/bin/pg_dumpall --schema-only" > $DEST/pg_schema.sql |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Dumping config to $DEST" |
|
|
|
cp -a /var/lib/pgsql/{{ (pg_version != 'default') | ternary(pg_version | string + '/','') }}data/postgresql.conf $DEST/ |
|
|
|
cp -a /var/lib/pgsql/{{ (pg_version != 'default') | ternary(pg_version | string + '/','') }}data/postgresql.conf $DEST/ |
|
|
|
cp -a /var/lib/pgsql/{{ (pg_version != 'default') | ternary(pg_version | string + '/','') }}data/pg_hba.conf $DEST/ |
|
|
|
cp -a /var/lib/pgsql/{{ (pg_version != 'default') | ternary(pg_version | string + '/','') }}data/pg_hba.conf $DEST/ |
|
|
|