The db.py script can be used to dump and restore a PostgreSQL database.


This script can be used only for the PostgreSQL service. Don't run this script on a remote database. Execute the script only when the database is up and running.


Run this script as follows:


Required options:

-a | --action
Values: dump or restore
-f | --path
Path where the database backup file will be created. Must be a directory owned by the postgresql user (usually /var/lib/pgsql/9.0/). Can be a new directory.

Optional options:

-t | --type
Specifies the type of database (ctf or reporting).
-h | --help
Print this usage message and exit.
Note: The options -a and -f are mandatory.