Scripts

This chapter presents the available scripts. All our scripts have a detailed synopsis please, check the option “-h” or “—help”.

Operating system Start/Stop integration

DMK provides a tiny script which integrated to the boot procedure serves to start & stop all the PostgreSQL services smoothly for either SYSV or systemd based Linux dsitributions:

init.d script

cat ${DMK_HOME}/templates/init.d/postgres.linux
#!/bin/bash
...
case "$1" in
'start')
 "${DMK_HOME:-/u01/app/postgres/local/dmk}/bin/postgres.sh" start
 touch /var/lock/subsys/postgres
;;
'stop')
 "${DMK_HOME:-/u01/app/postgres/local/dmk}/bin/postgres.sh" stop
 rm -f /var/lock/subsys/postgres
;;
*)
 echo "usage $0 {start|stop}"
 exit 1
;;
esac

systemd service file

This script serves to start/stop all databases simultaneously which have the "Y" define in the pgtab file:

fsdisc.ksh

This script prompts in a graphical way the file system usage. The alias “f” refers to this script.

Syntax

dmk-run.bash

This script prints the status of several PostgreSQL components. It’s commonly launched with the short aliases “sta”, “ser” or “u”.

Please check the respective platform script as the features differ (i.e. hiding stopped components)

Syntax

This script prints the version and level of patch for each DMK package installed on the system.

This script is parsing the PostgreSQL log file and alerts whenever an issue is found:

This script is used to perform basic health check against a PostgreSQL instance and is ending alerts in case of any issues:

This script is a wrapper around pgBadger and periodically generates pgBadger reports:

In case BARMAN is used to create PostgreSQL backups this script is a wrapper for automating backups with BARMAN:

This script is used to automatically create PostgreSQL instances:

This script helps with doing logical dumps of PostgreSQL instances:

dmk-pgpool-*.sh

The dmk-pgpool scripts provide integration with pgpgool when it comes to automated failover and can be used as templates for custom setups.

Last updated