Clemens Schwaighofer 806247996d Clean up all scripts to match bash linting rules
pg_db_dump_file log parameter never set the log folder, it was always overwritten

pg_drop_restore had a double ;; inside which stopped the script from working

All: remove -a flag for Amazon Linux OS. This was only for V1 type and we do no longer support this (or use it) and V2 AWS Linux is based more on a redhat type, so the -r flag will work

Various other formatting updates

Change all strange ls to find calls

Change all exec calls with params to params in array
2025-04-15 08:40:21 +09:00
2024-09-03 12:40:48 +09:00
2021-12-14 06:47:15 +09:00

PostgreSQL database dump scripts

pg_db_dump_file.sh

Dump all database in a cluster, each database gets its own file. pg globals is dumped extra.

Via settings the keep time or keep amount can be set. Also database can be exluded or only serval databases selected for dump.

The file format is dump standard for automatic restore via pg_drop_restore.sh or pg_restore_db_file.sh

<database name>.<owner>.<database type>-<version>_<host>_<port>_<date in YYYYMMDD>_<time in HHMM>_<sequenze>

pg_drop_restore.sh

Counterpart to pg_db_dump_file.sh. Restores a single file to one database. If the standard file name is given, will restore as set in the file name.

pg_restore_db_file.sh

Mass restore for dumped files. It will first try to restore the pg globals file and then all databse files.

Description
Scripts for dumping and resting PostgreSQL databases
Readme 158 KiB
Languages
Shell 100%