2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
# Configuration Definition Data
|
2017-08-25 22:47:47 +02:00
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# Contains the defines for options: which commands the option can/cannot be specified, for which commands it is required, default
|
2017-08-25 22:47:47 +02:00
|
|
|
# settings, types, ranges, whether the option is negatable, whether it has dependencies, etc. The initial section is the global
|
2017-11-02 14:14:13 +02:00
|
|
|
# section meaning the defines defined there apply to all commands listed for the option.
|
2017-08-25 22:47:47 +02:00
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_COMMAND:
|
2017-09-01 01:15:44 +02:00
|
|
|
# List of commands the option can be used with this option. An empty hash signifies that the command does not deviate from the
|
2017-08-25 22:47:47 +02:00
|
|
|
# option defaults. Otherwise, overrides can be specified.
|
|
|
|
#
|
|
|
|
# NOTE: If the option (A) has a dependency on another option (B) then the CFGCMD_ must also be specified in the other option
|
|
|
|
# (B), else it will still error on the option (A).
|
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_REQUIRED:
|
2017-08-25 22:47:47 +02:00
|
|
|
# In global section:
|
2017-11-02 14:14:13 +02:00
|
|
|
# true - if the option does not have a default, then setting CFGDEF_REQUIRED in the global section means all commands
|
|
|
|
# listed in CFGDEF_COMMAND require the user to set it.
|
2017-08-25 22:47:47 +02:00
|
|
|
# false - no commands listed require it as an option but it can be set. This can be overridden for individual commands by
|
2017-11-02 14:14:13 +02:00
|
|
|
# setting CFGDEF_REQUIRED in the CFGDEF_COMMAND section.
|
|
|
|
# In CFGDEF_COMMAND section:
|
|
|
|
# true - the option must be set somehow for the command, either by default (CFGDEF_DEFAULT) or by the user.
|
2017-08-25 22:47:47 +02:00
|
|
|
# &CFGCMD_CHECK =>
|
|
|
|
# {
|
2017-11-02 14:14:13 +02:00
|
|
|
# &CFGDEF_REQUIRED => true
|
2017-08-25 22:47:47 +02:00
|
|
|
# },
|
2017-11-02 14:14:13 +02:00
|
|
|
# false - mainly used for overriding the CFGDEF_REQUIRED in the global section.
|
2017-08-25 22:47:47 +02:00
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_DEFAULT:
|
2017-08-25 22:47:47 +02:00
|
|
|
# Sets a default for the option for all commands if listed in the global section, or for specific commands if listed in the
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_COMMAND section.
|
2017-08-25 22:47:47 +02:00
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_NEGATE:
|
2017-08-25 22:47:47 +02:00
|
|
|
# The option can be negated with "no" e.g. --no-compress. This applies tp options that are only valid on the command line (i.e.
|
|
|
|
# no config section defined). All config options are automatically negatable.
|
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_DEPEND:
|
2017-08-25 22:47:47 +02:00
|
|
|
# Specify the dependencies this option has on another option. All commands listed for this option must also be listed in the
|
|
|
|
# dependent option(s).
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_DEPEND_LIST further defines the allowable settings for the depended option.
|
2017-08-25 22:47:47 +02:00
|
|
|
#
|
2017-11-02 14:14:13 +02:00
|
|
|
# CFGDEF_ALLOW_LIST:
|
2017-08-25 22:47:47 +02:00
|
|
|
# Lists the allowable settings for the option.
|
2017-12-05 21:46:52 +02:00
|
|
|
#
|
|
|
|
# CFGDEF_INTERNAL:
|
|
|
|
# Option is used by the command internally but is not exposed in the documentation. This is useful for commands that need to know
|
|
|
|
# where they are running by looking at other options in the config. Also good for test options.
|
2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
2017-11-27 00:45:00 +02:00
|
|
|
package pgBackRestBuild::Config::Data;
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings FATAL => qw(all);
|
|
|
|
use Carp qw(confess);
|
|
|
|
|
|
|
|
use Cwd qw(abs_path);
|
|
|
|
use Exporter qw(import);
|
|
|
|
our @EXPORT = qw();
|
|
|
|
use File::Basename qw(dirname basename);
|
|
|
|
use Getopt::Long qw(GetOptions);
|
|
|
|
use Storable qw(dclone);
|
|
|
|
|
|
|
|
use pgBackRest::Common::Exception;
|
|
|
|
use pgBackRest::Common::Ini;
|
|
|
|
use pgBackRest::Common::Io::Base;
|
|
|
|
use pgBackRest::Common::Log;
|
|
|
|
use pgBackRest::Common::Wait;
|
|
|
|
use pgBackRest::Version;
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Command constants - commands that are allowed in pgBackRest
|
|
|
|
####################################################################################################################################
|
|
|
|
use constant CFGCMD_ARCHIVE_GET => 'archive-get';
|
|
|
|
push @EXPORT, qw(CFGCMD_ARCHIVE_GET);
|
|
|
|
use constant CFGCMD_ARCHIVE_PUSH => 'archive-push';
|
|
|
|
push @EXPORT, qw(CFGCMD_ARCHIVE_PUSH);
|
|
|
|
use constant CFGCMD_BACKUP => 'backup';
|
|
|
|
push @EXPORT, qw(CFGCMD_BACKUP);
|
|
|
|
use constant CFGCMD_CHECK => 'check';
|
|
|
|
push @EXPORT, qw(CFGCMD_CHECK);
|
|
|
|
use constant CFGCMD_EXPIRE => 'expire';
|
|
|
|
push @EXPORT, qw(CFGCMD_EXPIRE);
|
|
|
|
use constant CFGCMD_HELP => 'help';
|
|
|
|
push @EXPORT, qw(CFGCMD_HELP);
|
|
|
|
use constant CFGCMD_INFO => 'info';
|
|
|
|
push @EXPORT, qw(CFGCMD_INFO);
|
|
|
|
use constant CFGCMD_LOCAL => 'local';
|
|
|
|
push @EXPORT, qw(CFGCMD_LOCAL);
|
|
|
|
use constant CFGCMD_REMOTE => 'remote';
|
|
|
|
push @EXPORT, qw(CFGCMD_REMOTE);
|
|
|
|
use constant CFGCMD_RESTORE => 'restore';
|
|
|
|
push @EXPORT, qw(CFGCMD_RESTORE);
|
|
|
|
use constant CFGCMD_STANZA_CREATE => 'stanza-create';
|
|
|
|
push @EXPORT, qw(CFGCMD_STANZA_CREATE);
|
|
|
|
use constant CFGCMD_STANZA_UPGRADE => 'stanza-upgrade';
|
|
|
|
push @EXPORT, qw(CFGCMD_STANZA_UPGRADE);
|
|
|
|
use constant CFGCMD_START => 'start';
|
|
|
|
push @EXPORT, qw(CFGCMD_START);
|
|
|
|
use constant CFGCMD_STOP => 'stop';
|
|
|
|
push @EXPORT, qw(CFGCMD_STOP);
|
|
|
|
use constant CFGCMD_VERSION => 'version';
|
|
|
|
push @EXPORT, qw(CFGCMD_VERSION);
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Option constants - options that are allowed for commands
|
|
|
|
####################################################################################################################################
|
|
|
|
|
|
|
|
# Command-line only options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_CONFIG => 'config';
|
|
|
|
push @EXPORT, qw(CFGOPT_CONFIG);
|
|
|
|
use constant CFGOPT_DELTA => 'delta';
|
|
|
|
push @EXPORT, qw(CFGOPT_DELTA);
|
|
|
|
use constant CFGOPT_FORCE => 'force';
|
|
|
|
push @EXPORT, qw(CFGOPT_FORCE);
|
|
|
|
use constant CFGOPT_ONLINE => 'online';
|
|
|
|
push @EXPORT, qw(CFGOPT_ONLINE);
|
|
|
|
use constant CFGOPT_SET => 'set';
|
|
|
|
push @EXPORT, qw(CFGOPT_SET);
|
|
|
|
use constant CFGOPT_STANZA => 'stanza';
|
|
|
|
push @EXPORT, qw(CFGOPT_STANZA);
|
|
|
|
use constant CFGOPT_TARGET => 'target';
|
|
|
|
push @EXPORT, qw(CFGOPT_TARGET);
|
|
|
|
use constant CFGOPT_TARGET_EXCLUSIVE => 'target-exclusive';
|
|
|
|
push @EXPORT, qw(CFGOPT_TARGET_EXCLUSIVE);
|
|
|
|
use constant CFGOPT_TARGET_ACTION => 'target-action';
|
|
|
|
push @EXPORT, qw(CFGOPT_TARGET_ACTION);
|
|
|
|
use constant CFGOPT_TARGET_TIMELINE => 'target-timeline';
|
|
|
|
push @EXPORT, qw(CFGOPT_TARGET_TIMELINE);
|
|
|
|
use constant CFGOPT_TYPE => 'type';
|
|
|
|
push @EXPORT, qw(CFGOPT_TYPE);
|
|
|
|
use constant CFGOPT_OUTPUT => 'output';
|
|
|
|
push @EXPORT, qw(CFGOPT_OUTPUT);
|
|
|
|
|
|
|
|
# Command-line only local/remote optiosn
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_COMMAND => 'command';
|
|
|
|
push @EXPORT, qw(CFGOPT_COMMAND);
|
|
|
|
use constant CFGOPT_PROCESS => 'process';
|
|
|
|
push @EXPORT, qw(CFGOPT_PROCESS);
|
|
|
|
use constant CFGOPT_HOST_ID => 'host-id';
|
|
|
|
push @EXPORT, qw(CFGOPT_HOST_ID);
|
|
|
|
|
|
|
|
# Command-line only test options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_TEST => 'test';
|
|
|
|
push @EXPORT, qw(CFGOPT_TEST);
|
|
|
|
use constant CFGOPT_TEST_DELAY => 'test-delay';
|
|
|
|
push @EXPORT, qw(CFGOPT_TEST_DELAY);
|
|
|
|
use constant CFGOPT_TEST_POINT => 'test-point';
|
|
|
|
push @EXPORT, qw(CFGOPT_TEST_POINT);
|
|
|
|
|
|
|
|
# General options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_ARCHIVE_TIMEOUT => 'archive-timeout';
|
|
|
|
push @EXPORT, qw(CFGOPT_ARCHIVE_TIMEOUT);
|
|
|
|
use constant CFGOPT_BUFFER_SIZE => 'buffer-size';
|
|
|
|
push @EXPORT, qw(CFGOPT_BUFFER_SIZE);
|
|
|
|
use constant CFGOPT_DB_TIMEOUT => 'db-timeout';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_TIMEOUT);
|
|
|
|
use constant CFGOPT_COMPRESS => 'compress';
|
|
|
|
push @EXPORT, qw(CFGOPT_COMPRESS);
|
|
|
|
use constant CFGOPT_COMPRESS_LEVEL => 'compress-level';
|
|
|
|
push @EXPORT, qw(CFGOPT_COMPRESS_LEVEL);
|
|
|
|
use constant CFGOPT_COMPRESS_LEVEL_NETWORK => 'compress-level-network';
|
|
|
|
push @EXPORT, qw(CFGOPT_COMPRESS_LEVEL_NETWORK);
|
|
|
|
use constant CFGOPT_NEUTRAL_UMASK => 'neutral-umask';
|
|
|
|
push @EXPORT, qw(CFGOPT_NEUTRAL_UMASK);
|
|
|
|
use constant CFGOPT_PROTOCOL_TIMEOUT => 'protocol-timeout';
|
|
|
|
push @EXPORT, qw(CFGOPT_PROTOCOL_TIMEOUT);
|
|
|
|
use constant CFGOPT_PROCESS_MAX => 'process-max';
|
|
|
|
push @EXPORT, qw(CFGOPT_PROCESS_MAX);
|
|
|
|
|
|
|
|
# Commands
|
|
|
|
use constant CFGOPT_CMD_SSH => 'cmd-ssh';
|
|
|
|
push @EXPORT, qw(CFGOPT_CMD_SSH);
|
|
|
|
|
|
|
|
# Paths
|
|
|
|
use constant CFGOPT_LOCK_PATH => 'lock-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_LOCK_PATH);
|
|
|
|
use constant CFGOPT_LOG_PATH => 'log-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_LOG_PATH);
|
|
|
|
use constant CFGOPT_SPOOL_PATH => 'spool-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_SPOOL_PATH);
|
|
|
|
|
|
|
|
# Repository
|
|
|
|
use constant CFGOPT_REPO_PATH => 'repo-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_PATH);
|
|
|
|
use constant CFGOPT_REPO_TYPE => 'repo-type';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_TYPE);
|
2017-11-06 19:51:12 +02:00
|
|
|
use constant CFGOPT_REPO_CIPHER_TYPE => 'repo-cipher-type';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_CIPHER_TYPE);
|
|
|
|
use constant CFGOPT_REPO_CIPHER_PASS => 'repo-cipher-pass';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_CIPHER_PASS);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
# Repository S3
|
|
|
|
use constant CFGOPT_REPO_S3_KEY => 'repo-s3-key';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_KEY);
|
|
|
|
use constant CFGOPT_REPO_S3_KEY_SECRET => 'repo-s3-key-secret';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_KEY_SECRET);
|
|
|
|
use constant CFGOPT_REPO_S3_BUCKET => 'repo-s3-bucket';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_BUCKET);
|
|
|
|
use constant CFGOPT_REPO_S3_CA_FILE => 'repo-s3-ca-file';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_CA_FILE);
|
|
|
|
use constant CFGOPT_REPO_S3_CA_PATH => 'repo-s3-ca-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_CA_PATH);
|
|
|
|
use constant CFGOPT_REPO_S3_ENDPOINT => 'repo-s3-endpoint';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_ENDPOINT);
|
|
|
|
use constant CFGOPT_REPO_S3_HOST => 'repo-s3-host';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_HOST);
|
|
|
|
use constant CFGOPT_REPO_S3_REGION => 'repo-s3-region';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_REGION);
|
|
|
|
use constant CFGOPT_REPO_S3_VERIFY_SSL => 'repo-s3-verify-ssl';
|
|
|
|
push @EXPORT, qw(CFGOPT_REPO_S3_VERIFY_SSL);
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
use constant CFGOPT_LOG_LEVEL_CONSOLE => 'log-level-console';
|
|
|
|
push @EXPORT, qw(CFGOPT_LOG_LEVEL_CONSOLE);
|
|
|
|
use constant CFGOPT_LOG_LEVEL_FILE => 'log-level-file';
|
|
|
|
push @EXPORT, qw(CFGOPT_LOG_LEVEL_FILE);
|
|
|
|
use constant CFGOPT_LOG_LEVEL_STDERR => 'log-level-stderr';
|
|
|
|
push @EXPORT, qw(CFGOPT_LOG_LEVEL_STDERR);
|
|
|
|
use constant CFGOPT_LOG_TIMESTAMP => 'log-timestamp';
|
|
|
|
push @EXPORT, qw(CFGOPT_LOG_TIMESTAMP);
|
|
|
|
|
|
|
|
# Archive options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_ARCHIVE_ASYNC => 'archive-async';
|
|
|
|
push @EXPORT, qw(CFGOPT_ARCHIVE_ASYNC);
|
|
|
|
use constant CFGOPT_ARCHIVE_QUEUE_MAX => 'archive-queue-max';
|
|
|
|
push @EXPORT, qw(CFGOPT_ARCHIVE_QUEUE_MAX);
|
|
|
|
|
|
|
|
# Backup options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_ARCHIVE_CHECK => 'archive-check';
|
|
|
|
push @EXPORT, qw(CFGOPT_ARCHIVE_CHECK);
|
|
|
|
use constant CFGOPT_ARCHIVE_COPY => 'archive-copy';
|
|
|
|
push @EXPORT, qw(CFGOPT_ARCHIVE_COPY);
|
|
|
|
use constant CFGOPT_BACKUP_CMD => 'backup-cmd';
|
|
|
|
push @EXPORT, qw(CFGOPT_BACKUP_CMD);
|
|
|
|
use constant CFGOPT_BACKUP_CONFIG => 'backup-config';
|
|
|
|
push @EXPORT, qw(CFGOPT_BACKUP_CONFIG);
|
|
|
|
use constant CFGOPT_BACKUP_HOST => 'backup-host';
|
|
|
|
push @EXPORT, qw(CFGOPT_BACKUP_HOST);
|
|
|
|
use constant CFGOPT_BACKUP_SSH_PORT => 'backup-ssh-port';
|
|
|
|
push @EXPORT, qw(CFGOPT_BACKUP_SSH_PORT);
|
|
|
|
use constant CFGOPT_BACKUP_STANDBY => 'backup-standby';
|
|
|
|
push @EXPORT, qw(CFGOPT_BACKUP_STANDBY);
|
|
|
|
use constant CFGOPT_BACKUP_USER => 'backup-user';
|
|
|
|
push @EXPORT, qw(CFGOPT_BACKUP_USER);
|
|
|
|
use constant CFGOPT_CHECKSUM_PAGE => 'checksum-page';
|
|
|
|
push @EXPORT, qw(CFGOPT_CHECKSUM_PAGE);
|
|
|
|
use constant CFGOPT_HARDLINK => 'hardlink';
|
|
|
|
push @EXPORT, qw(CFGOPT_HARDLINK);
|
|
|
|
use constant CFGOPT_MANIFEST_SAVE_THRESHOLD => 'manifest-save-threshold';
|
|
|
|
push @EXPORT, qw(CFGOPT_MANIFEST_SAVE_THRESHOLD);
|
|
|
|
use constant CFGOPT_RESUME => 'resume';
|
|
|
|
push @EXPORT, qw(CFGOPT_RESUME);
|
|
|
|
use constant CFGOPT_START_FAST => 'start-fast';
|
|
|
|
push @EXPORT, qw(CFGOPT_START_FAST);
|
|
|
|
use constant CFGOPT_STOP_AUTO => 'stop-auto';
|
|
|
|
push @EXPORT, qw(CFGOPT_STOP_AUTO);
|
|
|
|
|
|
|
|
# Expire options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_RETENTION_ARCHIVE => 'retention-archive';
|
|
|
|
push @EXPORT, qw(CFGOPT_RETENTION_ARCHIVE);
|
|
|
|
use constant CFGOPT_RETENTION_ARCHIVE_TYPE => 'retention-archive-type';
|
|
|
|
push @EXPORT, qw(CFGOPT_RETENTION_ARCHIVE_TYPE);
|
|
|
|
use constant CFGOPT_RETENTION_DIFF => 'retention-diff';
|
|
|
|
push @EXPORT, qw(CFGOPT_RETENTION_DIFF);
|
|
|
|
use constant CFGOPT_RETENTION_FULL => 'retention-full';
|
|
|
|
push @EXPORT, qw(CFGOPT_RETENTION_FULL);
|
|
|
|
|
|
|
|
# Restore options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPT_DB_INCLUDE => 'db-include';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_INCLUDE);
|
|
|
|
use constant CFGOPT_LINK_ALL => 'link-all';
|
|
|
|
push @EXPORT, qw(CFGOPT_LINK_ALL);
|
|
|
|
use constant CFGOPT_LINK_MAP => 'link-map';
|
|
|
|
push @EXPORT, qw(CFGOPT_LINK_MAP);
|
|
|
|
use constant CFGOPT_TABLESPACE_MAP_ALL => 'tablespace-map-all';
|
|
|
|
push @EXPORT, qw(CFGOPT_TABLESPACE_MAP_ALL);
|
|
|
|
use constant CFGOPT_TABLESPACE_MAP => 'tablespace-map';
|
|
|
|
push @EXPORT, qw(CFGOPT_TABLESPACE_MAP);
|
|
|
|
use constant CFGOPT_RECOVERY_OPTION => 'recovery-option';
|
|
|
|
push @EXPORT, qw(CFGOPT_RECOVERY_OPTION);
|
|
|
|
|
|
|
|
# Stanza options
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# Determines how many databases can be configured
|
2017-09-01 01:15:44 +02:00
|
|
|
use constant CFGDEF_INDEX_DB => 8;
|
2017-11-02 14:14:13 +02:00
|
|
|
push @EXPORT, qw(CFGDEF_INDEX_DB);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
# Prefix that must be used by all db options that allow multiple configurations
|
|
|
|
use constant CFGDEF_PREFIX_DB => 'db';
|
2017-11-02 14:14:13 +02:00
|
|
|
push @EXPORT, qw(CFGDEF_PREFIX_DB);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
use constant CFGOPT_DB_CMD => CFGDEF_PREFIX_DB . '-cmd';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_CMD);
|
|
|
|
use constant CFGOPT_DB_CONFIG => CFGDEF_PREFIX_DB . '-config';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_CONFIG);
|
|
|
|
use constant CFGOPT_DB_HOST => CFGDEF_PREFIX_DB . '-host';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_HOST);
|
|
|
|
use constant CFGOPT_DB_PATH => CFGDEF_PREFIX_DB . '-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_PATH);
|
|
|
|
use constant CFGOPT_DB_PORT => CFGDEF_PREFIX_DB . '-port';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_PORT);
|
|
|
|
use constant CFGOPT_DB_SSH_PORT => CFGDEF_PREFIX_DB . '-ssh-port';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_SSH_PORT);
|
|
|
|
use constant CFGOPT_DB_SOCKET_PATH => CFGDEF_PREFIX_DB . '-socket-path';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_SOCKET_PATH);
|
|
|
|
use constant CFGOPT_DB_USER => CFGDEF_PREFIX_DB . '-user';
|
|
|
|
push @EXPORT, qw(CFGOPT_DB_USER);
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Option values - for options that have a specific list of allowed values
|
|
|
|
####################################################################################################################################
|
|
|
|
|
|
|
|
# Local/remote types
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_LOCAL_TYPE_DB => 'db';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_LOCAL_TYPE_DB);
|
|
|
|
use constant CFGOPTVAL_LOCAL_TYPE_BACKUP => 'backup';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_LOCAL_TYPE_BACKUP);
|
|
|
|
use constant CFGOPTVAL_REMOTE_TYPE_DB => CFGOPTVAL_LOCAL_TYPE_DB;
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REMOTE_TYPE_DB);
|
|
|
|
use constant CFGOPTVAL_REMOTE_TYPE_BACKUP => CFGOPTVAL_LOCAL_TYPE_BACKUP;
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REMOTE_TYPE_BACKUP);
|
|
|
|
|
|
|
|
# Backup type
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_BACKUP_TYPE_FULL => 'full';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_BACKUP_TYPE_FULL);
|
|
|
|
use constant CFGOPTVAL_BACKUP_TYPE_DIFF => 'diff';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_BACKUP_TYPE_DIFF);
|
|
|
|
use constant CFGOPTVAL_BACKUP_TYPE_INCR => 'incr';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_BACKUP_TYPE_INCR);
|
|
|
|
|
|
|
|
# Repo type
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_REPO_TYPE_CIFS => 'cifs';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REPO_TYPE_CIFS);
|
|
|
|
use constant CFGOPTVAL_REPO_TYPE_POSIX => 'posix';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REPO_TYPE_POSIX);
|
|
|
|
use constant CFGOPTVAL_REPO_TYPE_S3 => 's3';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REPO_TYPE_S3);
|
|
|
|
|
2017-11-06 19:51:12 +02:00
|
|
|
# Repo encryption type
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_REPO_CIPHER_TYPE_NONE => 'none';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REPO_CIPHER_TYPE_NONE);
|
|
|
|
use constant CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC => 'aes-256-cbc';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC);
|
|
|
|
|
2017-08-25 22:47:47 +02:00
|
|
|
# Info output
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_INFO_OUTPUT_TEXT => 'text';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_INFO_OUTPUT_TEXT);
|
|
|
|
use constant CFGOPTVAL_INFO_OUTPUT_JSON => 'json';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_INFO_OUTPUT_JSON);
|
|
|
|
|
|
|
|
# Restore type
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_NAME => 'name';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_NAME);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_TIME => 'time';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_TIME);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_XID => 'xid';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_XID);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_PRESERVE => 'preserve';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_PRESERVE);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_NONE => 'none';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_NONE);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_IMMEDIATE => 'immediate';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_IMMEDIATE);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TYPE_DEFAULT => 'default';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_DEFAULT);
|
|
|
|
|
|
|
|
# Restore target action
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
use constant CFGOPTVAL_RESTORE_TARGET_ACTION_PAUSE => 'pause';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TARGET_ACTION_PAUSE);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TARGET_ACTION_PROMOTE => 'promote';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TARGET_ACTION_PROMOTE);
|
|
|
|
use constant CFGOPTVAL_RESTORE_TARGET_ACTION_SHUTDOWN => 'shutdown';
|
|
|
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TARGET_ACTION_SHUTDOWN);
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Option defaults - only defined here when the default is used in more than one place
|
|
|
|
####################################################################################################################################
|
|
|
|
use constant CFGDEF_DEFAULT_BUFFER_SIZE_MIN => 16384;
|
|
|
|
|
|
|
|
use constant CFGDEF_DEFAULT_COMPRESS_LEVEL_MIN => 0;
|
|
|
|
use constant CFGDEF_DEFAULT_COMPRESS_LEVEL_MAX => 9;
|
|
|
|
|
|
|
|
use constant CFGDEF_DEFAULT_CONFIG => '/etc/' . BACKREST_CONF;
|
|
|
|
|
|
|
|
use constant CFGDEF_DEFAULT_DB_TIMEOUT => 1800;
|
|
|
|
use constant CFGDEF_DEFAULT_DB_TIMEOUT_MIN => WAIT_TIME_MINIMUM;
|
|
|
|
use constant CFGDEF_DEFAULT_DB_TIMEOUT_MAX => 86400 * 7;
|
|
|
|
|
|
|
|
use constant CFGDEF_DEFAULT_RETENTION_MIN => 1;
|
2017-11-02 14:14:13 +02:00
|
|
|
use constant CFGDEF_DEFAULT_RETENTION_MAX => 9999999;
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
# Option definition constants - defines, types, sections, etc.
|
2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
# Option defines
|
2017-08-25 22:47:47 +02:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
2017-11-02 14:14:13 +02:00
|
|
|
use constant CFGDEF_ALT_NAME => 'alt-name';
|
|
|
|
push @EXPORT, qw(CFGDEF_ALT_NAME);
|
|
|
|
use constant CFGDEF_ALLOW_LIST => 'allow-list';
|
|
|
|
push @EXPORT, qw(CFGDEF_ALLOW_LIST);
|
|
|
|
use constant CFGDEF_ALLOW_RANGE => 'allow-range';
|
|
|
|
push @EXPORT, qw(CFGDEF_ALLOW_RANGE);
|
|
|
|
use constant CFGDEF_DEFAULT => 'default';
|
|
|
|
push @EXPORT, qw(CFGDEF_DEFAULT);
|
|
|
|
use constant CFGDEF_DEPEND => 'depend';
|
|
|
|
push @EXPORT, qw(CFGDEF_DEPEND);
|
|
|
|
use constant CFGDEF_DEPEND_OPTION => 'depend-option';
|
|
|
|
push @EXPORT, qw(CFGDEF_DEPEND_OPTION);
|
|
|
|
use constant CFGDEF_DEPEND_LIST => 'depend-list';
|
|
|
|
push @EXPORT, qw(CFGDEF_DEPEND_LIST);
|
|
|
|
use constant CFGDEF_INDEX => 'index';
|
|
|
|
push @EXPORT, qw(CFGDEF_INDEX);
|
|
|
|
use constant CFGDEF_INDEX_TOTAL => 'indexTotal';
|
|
|
|
push @EXPORT, qw(CFGDEF_INDEX_TOTAL);
|
2017-12-05 21:46:52 +02:00
|
|
|
use constant CFGDEF_INTERNAL => 'internal';
|
|
|
|
push @EXPORT, qw(CFGDEF_INTERNAL);
|
2017-11-02 14:14:13 +02:00
|
|
|
use constant CFGDEF_NEGATE => 'negate';
|
|
|
|
push @EXPORT, qw(CFGDEF_NEGATE);
|
|
|
|
use constant CFGDEF_PREFIX => 'prefix';
|
|
|
|
push @EXPORT, qw(CFGDEF_PREFIX);
|
|
|
|
use constant CFGDEF_COMMAND => 'command';
|
|
|
|
push @EXPORT, qw(CFGDEF_COMMAND);
|
|
|
|
use constant CFGDEF_REQUIRED => 'required';
|
|
|
|
push @EXPORT, qw(CFGDEF_REQUIRED);
|
|
|
|
use constant CFGDEF_SECTION => 'section';
|
|
|
|
push @EXPORT, qw(CFGDEF_SECTION);
|
|
|
|
use constant CFGDEF_SECURE => 'secure';
|
|
|
|
push @EXPORT, qw(CFGDEF_SECURE);
|
|
|
|
use constant CFGDEF_TYPE => 'type';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE);
|
|
|
|
|
|
|
|
# Option types
|
2017-08-25 22:47:47 +02:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
2017-11-02 14:14:13 +02:00
|
|
|
use constant CFGDEF_TYPE_BOOLEAN => 'boolean';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE_BOOLEAN);
|
|
|
|
use constant CFGDEF_TYPE_FLOAT => 'float';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE_FLOAT);
|
|
|
|
use constant CFGDEF_TYPE_HASH => 'hash';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE_HASH);
|
|
|
|
use constant CFGDEF_TYPE_INTEGER => 'integer';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE_INTEGER);
|
|
|
|
use constant CFGDEF_TYPE_LIST => 'list';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE_LIST);
|
|
|
|
use constant CFGDEF_TYPE_STRING => 'string';
|
|
|
|
push @EXPORT, qw(CFGDEF_TYPE_STRING);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
# Option config sections
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
2017-11-02 14:14:13 +02:00
|
|
|
use constant CFGDEF_SECTION_GLOBAL => 'global';
|
2017-08-25 22:47:47 +02:00
|
|
|
push @EXPORT, qw(CFGDEF_SECTION_GLOBAL);
|
2017-11-02 14:14:13 +02:00
|
|
|
use constant CFGDEF_SECTION_STANZA => 'stanza';
|
2017-08-25 22:47:47 +02:00
|
|
|
push @EXPORT, qw(CFGDEF_SECTION_STANZA);
|
|
|
|
|
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
# Option definition data
|
2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
my %hConfigDefine =
|
2017-08-25 22:47:47 +02:00
|
|
|
(
|
|
|
|
# Command-line only options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_CONFIG =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => CFGDEF_DEFAULT_CONFIG,
|
|
|
|
&CFGDEF_NEGATE => true,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DELTA =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false,
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_FORCE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_ONLINE,
|
|
|
|
&CFGDEF_DEPEND_LIST => [false],
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGCMD_STANZA_CREATE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGCMD_STOP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_ONLINE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_NEGATE => true,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_SET =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => 'latest',
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_STANZA =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_STOP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TARGET =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_NAME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_TIME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_XID,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TARGET_EXCLUSIVE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_TIME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_XID,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TARGET_ACTION =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_RESTORE_TARGET_ACTION_PAUSE,
|
2017-08-25 22:47:47 +02:00
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TARGET_ACTION_PAUSE,
|
|
|
|
&CFGOPTVAL_RESTORE_TARGET_ACTION_PROMOTE,
|
|
|
|
&CFGOPTVAL_RESTORE_TARGET_ACTION_SHUTDOWN,
|
|
|
|
],
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_NAME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_TIME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_XID,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TARGET_TIMELINE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_DEFAULT,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_NAME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_TIME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_XID,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TYPE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_BACKUP_TYPE_INCR,
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_BACKUP_TYPE_FULL,
|
|
|
|
&CFGOPTVAL_BACKUP_TYPE_DIFF,
|
|
|
|
&CFGOPTVAL_BACKUP_TYPE_INCR,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGCMD_LOCAL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_LOCAL_TYPE_DB,
|
|
|
|
&CFGOPTVAL_LOCAL_TYPE_BACKUP,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGCMD_REMOTE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_REMOTE_TYPE_DB,
|
|
|
|
&CFGOPTVAL_REMOTE_TYPE_BACKUP,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_RESTORE_TYPE_DEFAULT,
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_NAME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_TIME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_XID,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_PRESERVE,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_NONE,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_IMMEDIATE,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_DEFAULT,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_OUTPUT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_INFO =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_INFO_OUTPUT_TEXT,
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_INFO_OUTPUT_TEXT,
|
|
|
|
&CFGOPTVAL_INFO_OUTPUT_JSON,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
# Command-line only local/remote options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_COMMAND =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_HOST_ID =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_PROCESS =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_LOCAL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => true,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_REMOTE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Command-line only test options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_TEST =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
2017-12-05 21:46:52 +02:00
|
|
|
&CFGDEF_INTERNAL => true,
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TEST_DELAY =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_FLOAT,
|
2017-12-05 21:46:52 +02:00
|
|
|
&CFGDEF_INTERNAL => true,
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEFAULT => 5,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_TEST,
|
|
|
|
&CFGDEF_DEPEND_LIST => [true],
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND => CFGOPT_TEST,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TEST_POINT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_HASH,
|
2017-12-05 21:46:52 +02:00
|
|
|
&CFGDEF_INTERNAL => true,
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND => CFGOPT_TEST_DELAY,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_TEST,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
# General options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_ARCHIVE_TIMEOUT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_FLOAT,
|
|
|
|
&CFGDEF_DEFAULT => 60,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [WAIT_TIME_MINIMUM, 86400],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BUFFER_SIZE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_DEFAULT => COMMON_IO_BUFFER_MAX,
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 2,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 4,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 8,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 16,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 32,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 64,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 128,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 256,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 512,
|
|
|
|
&CFGDEF_DEFAULT_BUFFER_SIZE_MIN * 1024,
|
|
|
|
],
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_TIMEOUT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_FLOAT,
|
|
|
|
&CFGDEF_DEFAULT => CFGDEF_DEFAULT_DB_TIMEOUT,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_DB_TIMEOUT_MIN, CFGDEF_DEFAULT_DB_TIMEOUT_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_COMPRESS =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_COMPRESS_LEVEL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_DEFAULT => 6,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_COMPRESS_LEVEL_MIN, CFGDEF_DEFAULT_COMPRESS_LEVEL_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_COMPRESS_LEVEL_NETWORK =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_DEFAULT => 3,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_COMPRESS_LEVEL_MIN, CFGDEF_DEFAULT_COMPRESS_LEVEL_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_NEUTRAL_UMASK =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_CMD_SSH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => 'ssh',
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LOCK_PATH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => '/tmp/' . BACKREST_EXE,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LOG_PATH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => '/var/log/' . BACKREST_EXE,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_PROTOCOL_TIMEOUT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_FLOAT,
|
|
|
|
&CFGDEF_DEFAULT => CFGDEF_DEFAULT_DB_TIMEOUT + 30,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_DB_TIMEOUT_MIN, CFGDEF_DEFAULT_DB_TIMEOUT_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-11-06 19:51:12 +02:00
|
|
|
&CFGOPT_REPO_CIPHER_PASS =>
|
|
|
|
{
|
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_SECURE => true,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
|
|
|
{
|
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_REPO_CIPHER_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST => [CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC],
|
|
|
|
},
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_REPO_CIPHER_TYPE =>
|
|
|
|
{
|
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_REPO_CIPHER_TYPE_NONE,
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
|
|
|
[
|
|
|
|
&CFGOPTVAL_REPO_CIPHER_TYPE_NONE,
|
|
|
|
&CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC,
|
|
|
|
],
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
|
|
|
|
},
|
|
|
|
|
2017-08-25 22:47:47 +02:00
|
|
|
&CFGOPT_REPO_PATH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => '/var/lib/' . BACKREST_EXE,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_BUCKET =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_REPO_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST => [CFGOPTVAL_REPO_TYPE_S3],
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_CA_FILE => &CFGOPT_REPO_S3_HOST,
|
|
|
|
&CFGOPT_REPO_S3_CA_PATH => &CFGOPT_REPO_S3_HOST,
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_KEY =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_SECURE => true,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_REPO_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST => [CFGOPTVAL_REPO_TYPE_S3],
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_KEY_SECRET => CFGOPT_REPO_S3_KEY,
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_ENDPOINT => CFGOPT_REPO_S3_BUCKET,
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_HOST =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND => CFGOPT_REPO_S3_BUCKET,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_REGION => CFGOPT_REPO_S3_BUCKET,
|
|
|
|
|
|
|
|
&CFGOPT_REPO_S3_VERIFY_SSL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
|
|
|
|
&CFGDEF_DEPEND => CFGOPT_REPO_S3_BUCKET,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_REPO_TYPE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_REPO_TYPE_POSIX,
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_REPO_TYPE_CIFS,
|
|
|
|
&CFGOPTVAL_REPO_TYPE_POSIX,
|
|
|
|
&CFGOPTVAL_REPO_TYPE_S3,
|
|
|
|
],
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_SPOOL_PATH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => '/var/spool/' . BACKREST_EXE,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_ARCHIVE_ASYNC,
|
|
|
|
&CFGDEF_DEPEND_LIST => [true],
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_PROCESS_MAX =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_ALT_NAME => 'thread-max',
|
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_DEFAULT => 1,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [1, 96],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
# Logging options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_LOG_LEVEL_CONSOLE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => lc(WARN),
|
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
lc(OFF),
|
|
|
|
lc(ERROR),
|
|
|
|
lc(WARN),
|
|
|
|
lc(INFO),
|
|
|
|
lc(DETAIL),
|
|
|
|
lc(DEBUG),
|
|
|
|
lc(TRACE),
|
|
|
|
],
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LOG_LEVEL_FILE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => lc(INFO),
|
|
|
|
&CFGDEF_ALLOW_LIST => CFGOPT_LOG_LEVEL_CONSOLE,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_LOG_LEVEL_CONSOLE,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LOG_LEVEL_STDERR =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => lc(WARN),
|
|
|
|
&CFGDEF_ALLOW_LIST => CFGOPT_LOG_LEVEL_CONSOLE,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LOG_TIMESTAMP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_LOG_LEVEL_CONSOLE,
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
# Archive options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_ARCHIVE_ASYNC =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_ARCHIVE_QUEUE_MAX =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Backup options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_ARCHIVE_CHECK =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_ONLINE,
|
|
|
|
&CFGDEF_DEPEND_LIST => [true],
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_ARCHIVE_COPY =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_ARCHIVE_CHECK,
|
|
|
|
&CFGDEF_DEPEND_LIST => [true],
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BACKUP_CMD =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_BACKUP_HOST,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_BACKUP_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BACKUP_CONFIG =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => CFGDEF_DEFAULT_CONFIG,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_BACKUP_HOST,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_BACKUP_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BACKUP_HOST =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET => {},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
2017-12-05 21:59:09 +02:00
|
|
|
&CFGCMD_BACKUP =>
|
|
|
|
{
|
|
|
|
&CFGDEF_INTERNAL => true,
|
|
|
|
},
|
2017-08-25 22:47:47 +02:00
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_INFO => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BACKUP_SSH_PORT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_BACKUP_HOST,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_BACKUP_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BACKUP_STANDBY =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_BACKUP_USER =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => 'backrest',
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_BACKUP_HOST,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_BACKUP_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_CHECKSUM_PAGE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_HARDLINK =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_MANIFEST_SAVE_THRESHOLD =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_DEFAULT => 1073741824,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_RESUME =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => true,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_START_FAST =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_STOP_AUTO =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
# Expire options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_RETENTION_ARCHIVE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_RETENTION_MIN, CFGDEF_DEFAULT_RETENTION_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_RETENTION_ARCHIVE_TYPE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => CFGOPTVAL_BACKUP_TYPE_FULL,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_ALLOW_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_BACKUP_TYPE_FULL,
|
|
|
|
&CFGOPTVAL_BACKUP_TYPE_DIFF,
|
|
|
|
&CFGOPTVAL_BACKUP_TYPE_INCR,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_RETENTION_DIFF =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_RETENTION_MIN, CFGDEF_DEFAULT_RETENTION_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_RETENTION_FULL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_ALLOW_RANGE => [CFGDEF_DEFAULT_RETENTION_MIN, CFGDEF_DEFAULT_RETENTION_MAX],
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
# Restore options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_DB_INCLUDE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_LIST,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LINK_ALL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
|
|
|
|
&CFGDEF_DEFAULT => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_LINK_MAP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_HASH,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TABLESPACE_MAP_ALL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_TABLESPACE_MAP =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_HASH,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_RECOVERY_OPTION =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_HASH,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_TYPE,
|
|
|
|
&CFGDEF_DEPEND_LIST =>
|
2017-08-25 22:47:47 +02:00
|
|
|
[
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_DEFAULT,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_NAME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_TIME,
|
|
|
|
&CFGOPTVAL_RESTORE_TYPE_XID,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
# Stanza options
|
|
|
|
#-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
&CFGOPT_DB_CMD =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_DB_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_CONFIG =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_GLOBAL,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_DEFAULT => CFGDEF_DEFAULT_CONFIG,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_DB_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_HOST =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_PUSH => {},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_EXPIRE => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
2017-12-05 21:59:09 +02:00
|
|
|
&CFGCMD_RESTORE =>
|
|
|
|
{
|
|
|
|
&CFGDEF_INTERNAL => true,
|
|
|
|
},
|
2017-08-25 22:47:47 +02:00
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
&CFGCMD_START => {},
|
|
|
|
&CFGCMD_STOP => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_PATH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_REQUIRED => true,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_ARCHIVE_GET =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_ARCHIVE_PUSH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_LOCAL =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_REMOTE =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
&CFGCMD_RESTORE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_PORT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_DEFAULT => 5432,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_SSH_PORT =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_INTEGER,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND => CFGOPT_DB_HOST,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_DB_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_SOCKET_PATH =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_REMOTE => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
&CFGOPT_DB_USER =>
|
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_SECTION => CFGDEF_SECTION_STANZA,
|
|
|
|
&CFGDEF_PREFIX => CFGDEF_PREFIX_DB,
|
|
|
|
&CFGDEF_TYPE => CFGDEF_TYPE_STRING,
|
|
|
|
&CFGDEF_DEFAULT => 'postgres',
|
|
|
|
&CFGDEF_COMMAND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&CFGCMD_BACKUP => {},
|
|
|
|
&CFGCMD_CHECK => {},
|
|
|
|
&CFGCMD_LOCAL => {},
|
|
|
|
&CFGCMD_STANZA_CREATE => {},
|
|
|
|
&CFGCMD_STANZA_UPGRADE => {},
|
|
|
|
},
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_REQUIRED => false,
|
|
|
|
&CFGDEF_DEPEND =>
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
&CFGDEF_DEPEND_OPTION => CFGOPT_DB_HOST
|
2017-08-25 22:47:47 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
# Process define defaults
|
2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
foreach my $strKey (sort(keys(%hConfigDefine)))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
# If the define is a scalar then copy the entire define from the referenced option
|
|
|
|
if (!ref($hConfigDefine{$strKey}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey} = dclone($hConfigDefine{$hConfigDefine{$strKey}});
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# If the command section is a scalar then copy the section from the referenced option
|
2017-11-02 14:14:13 +02:00
|
|
|
if (defined($hConfigDefine{$strKey}{&CFGDEF_COMMAND}) && !ref($hConfigDefine{$strKey}{&CFGDEF_COMMAND}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_COMMAND} =
|
|
|
|
dclone($hConfigDefine{$hConfigDefine{$strKey}{&CFGDEF_COMMAND}}{&CFGDEF_COMMAND});
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# If the required section is a scalar then copy the section from the referenced option
|
2017-11-02 14:14:13 +02:00
|
|
|
if (defined($hConfigDefine{$strKey}{&CFGDEF_DEPEND}) && !ref($hConfigDefine{$strKey}{&CFGDEF_DEPEND}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_DEPEND} =
|
|
|
|
dclone($hConfigDefine{$hConfigDefine{$strKey}{&CFGDEF_DEPEND}}{&CFGDEF_DEPEND});
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# If the allow list is a scalar then copy the list from the referenced option
|
2017-11-02 14:14:13 +02:00
|
|
|
if (defined($hConfigDefine{$strKey}{&CFGDEF_ALLOW_LIST}) && !ref($hConfigDefine{$strKey}{&CFGDEF_ALLOW_LIST}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_ALLOW_LIST} =
|
|
|
|
dclone($hConfigDefine{$hConfigDefine{$strKey}{&CFGDEF_ALLOW_LIST}}{&CFGDEF_ALLOW_LIST});
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Default type is string
|
2017-11-02 14:14:13 +02:00
|
|
|
if (!defined($hConfigDefine{$strKey}{&CFGDEF_TYPE}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
|
|
|
&log(ASSERT, "type is required for option '${strKey}'");
|
|
|
|
}
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
# Default required is true
|
|
|
|
if (!defined($hConfigDefine{$strKey}{&CFGDEF_REQUIRED}))
|
|
|
|
{
|
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_REQUIRED} = true;
|
|
|
|
}
|
|
|
|
|
2017-12-05 21:46:52 +02:00
|
|
|
# Default internal is false
|
|
|
|
if (!defined($hConfigDefine{$strKey}{&CFGDEF_INTERNAL}))
|
2017-11-02 14:14:13 +02:00
|
|
|
{
|
2017-12-05 21:46:52 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_INTERNAL} = false;
|
2017-11-02 14:14:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Set index total for db-*
|
|
|
|
if (defined($hConfigDefine{$strKey}{&CFGDEF_PREFIX}) &&
|
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_PREFIX} eq CFGDEF_PREFIX_DB)
|
|
|
|
{
|
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_INDEX_TOTAL} = CFGDEF_INDEX_DB;
|
|
|
|
}
|
|
|
|
# Else default index total is 1
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_INDEX_TOTAL} = 1;
|
|
|
|
}
|
|
|
|
|
2017-08-25 22:47:47 +02:00
|
|
|
# All boolean config options can be negated. Boolean command-line options must be marked for negation individually.
|
2017-11-02 14:14:13 +02:00
|
|
|
if ($hConfigDefine{$strKey}{&CFGDEF_TYPE} eq CFGDEF_TYPE_BOOLEAN &&
|
|
|
|
defined($hConfigDefine{$strKey}{&CFGDEF_SECTION}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_NEGATE} = true;
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Default for negation is false
|
2017-11-02 14:14:13 +02:00
|
|
|
if (!defined($hConfigDefine{$strKey}{&CFGDEF_NEGATE}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_NEGATE} = false;
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# By default options are not secure
|
2017-11-02 14:14:13 +02:00
|
|
|
if (!defined($hConfigDefine{$strKey}{&CFGDEF_SECURE}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_SECURE} = false;
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Set all indices to 1 by default - this defines how many copies of any option there can be
|
2017-11-02 14:14:13 +02:00
|
|
|
if (!defined($hConfigDefine{$strKey}{&CFGDEF_INDEX_TOTAL}))
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
$hConfigDefine{$strKey}{&CFGDEF_INDEX_TOTAL} = 1;
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
# Get configuration definition
|
2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
sub cfgDefine
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
return dclone(\%hConfigDefine);
|
|
|
|
}
|
2017-08-25 22:47:47 +02:00
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
push @EXPORT, qw(cfgDefine);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Get list of all commands
|
|
|
|
####################################################################################################################################
|
|
|
|
sub cfgDefineCommandList
|
|
|
|
{
|
|
|
|
my $rhCommandMap;
|
2017-08-25 22:47:47 +02:00
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
# Get unique list of commands
|
|
|
|
foreach my $strOption (sort(keys(%hConfigDefine)))
|
|
|
|
{
|
|
|
|
foreach my $strCommand (sort(keys(%{$hConfigDefine{$strOption}{&CFGDEF_COMMAND}})))
|
|
|
|
{
|
|
|
|
$rhCommandMap->{$strCommand} = true;
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
# Add special commands
|
|
|
|
$rhCommandMap->{&CFGCMD_HELP} = true;
|
|
|
|
$rhCommandMap->{&CFGCMD_VERSION} = true;
|
|
|
|
|
|
|
|
# Return sorted list
|
|
|
|
return (sort(keys(%{$rhCommandMap})));
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
push @EXPORT, qw(cfgDefineCommandList);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
# Get list of all option types
|
2017-08-25 22:47:47 +02:00
|
|
|
####################################################################################################################################
|
2017-11-02 14:14:13 +02:00
|
|
|
sub cfgDefineOptionTypeList
|
2017-08-25 22:47:47 +02:00
|
|
|
{
|
2017-11-02 14:14:13 +02:00
|
|
|
my $rhOptionTypeMap;
|
|
|
|
|
|
|
|
# Get unique list of types
|
|
|
|
foreach my $strOption (sort(keys(%hConfigDefine)))
|
|
|
|
{
|
|
|
|
my $strOptionType = $hConfigDefine{$strOption}{&CFGDEF_TYPE};
|
|
|
|
|
|
|
|
if (!defined($rhOptionTypeMap->{$strOptionType}))
|
|
|
|
{
|
|
|
|
$rhOptionTypeMap->{$strOptionType} = true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
# Return sorted list
|
|
|
|
return (sort(keys(%{$rhOptionTypeMap})));
|
2017-08-25 22:47:47 +02:00
|
|
|
}
|
|
|
|
|
2017-11-02 14:14:13 +02:00
|
|
|
push @EXPORT, qw(cfgDefineOptionTypeList);
|
2017-08-25 22:47:47 +02:00
|
|
|
|
|
|
|
1;
|