rafaelma / pgbackman

PostgreSQL backup manager

Home Page:https://e-mc2.net/projects/pgbackman/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support multilevel configuration

rafaelma opened this issue · comments

Today, we support a singlelevel configuration system with two possible locations for our configuration file:

  1. $HOME/.pgbackman/pgbackman.conf
  2. /etc/pgbackman/pgbackman.conf

Pgbackman checks for a configuration file in these locations and in this order and will use the first one that exists. This means that you can always override: 2) with 1).

In a multilevel configuration system we will not override the entire configuration file but we will merge all the defined configuration files and will use the parameters values defined in the configuration file with higher priority if a parameter is defined in more than one file.

  1. /usr/share/pgbackman/pgbackman.fixed.conf
  2. /etc/pgbackman/pgbackman.fixed.conf
  3. Configuration file defined with the parameter -c / --config when executing pgbackman
  4. $HOME/.pgbackman/pgbackman.conf
  5. /etc/pgbackman/pgbackman.conf
  6. /usr/share/pgbackman/pgabckman.conf

With this implementation:

  • Local configuration will be kept during upgrades
  • The local configuration is separate from the package default
  • Several actors will be allow to have their own files
  • It is possible to provide package, host and user defaults, as well as locking down features on a host, package level.
  • Always well known where the admin made his changes