oadp
backup precheck
Run the backup precheck command before any subsequent backup steps.
Extended Description
The backup precheck command checks that the primary instance of every EDB Postgres cluster is in sync with its replicas.
If the check fails, the backup precheck command reports the error and exits with a non-zero exit code. Otherwise, it returns successfully with a zero exit code.
- The OpenShift® and Kubernetes version numbers.
- The Cloud Pak for Data version number.
This command is also available in oadp REST mode.
Syntax
cpd-cli oadp backup precheck \
[--backup-type] \
[--edb-sync-retries] \
[--edb-sync-retry-wait-duration] \
[--exclude-checks] \
[--help] \
[--ignore-warnings=true|false] \
[--include-checks] \
[--include-namespaces=<project-name1,project-name2,...>] \
[--tenant-operator-namespace=<project-name>]
# Global options
[--add_dir_header=true|false] \
[--alsologtostderr=true|false] \
[--cpd-namespace=<cpd-namespace>] \
[--kubeconfig=<kubeconfig-paths> \
[--log-level=info|debug|warn|error|panic|trace] \
[--log-backtrace-at traceLocation=<integer>] \
[--log-dir=<log_directory>] \
[--log-file=<log_file_name>] \
[--log_file_max_size=<uint>] \
[--logtostderr=true|false] \
[--namespace=<namespace-name>] \
[--one-output=true|false] \
[--skip-headers=true|false] \
[--skip-log-headers=true|false] \
[--stderrthreshold severity=<integer>] \
[--v=<integer>] \
[--verbose \
[--vmodule moduleSpec=<pattern1, pattern2, and so on>]
Arguments
| Argument | Description |
|---|---|
<trace-location> |
The stack trace location |
<severity> |
The log severity level |
Options
| Option | Description |
|---|---|
--backup-type |
The type of object that is being
backed up.
|
--edb-sync-retries |
Number of times to retry EDB
Postgres cluster sync check upon failure.
|
--edb-sync-retry-wait-duration |
Wait duration of EDB Postgres
cluster sync check retries upon failure.
|
--exclude-checks |
Comma-separated list of checks to
skip.
|
|
|
Display command
help.
|
--ignore-warnings |
When set to `true`, any backups
that have warnings will not be flagged as errors during restore
precheck.
|
--include-checks |
Comma-separated list of checks to
run. Checks that are not specified are not run.
|
--include-namespaces |
Include the specified
namespaces, including tethered namespaces, in the backup.
|
--tenant-operator-namespace |
Restrict the scope of backup or
restore commands to tenant operand namespaces that include tenant specific Cloud Pak Foundation
Service Operators and IBM Software Hub Operators only.
|
- Only the
--tenant-operator-namespaceoption or the--include-namespacesoption can be used at a time. Running the command with both flags returns an error. - Check tethered namespaces.
Global options
You can also use the following global options with this command:
| Option | Description |
|---|---|
--add_dir_header |
Add the file directory to the
header of log messages.
|
--alsologtostderr |
Log to standard error as well as
files.
Note: This option has no effect when
--logtostderr=true. |
--cpd-namespace |
The IBM Software Hub namespace in
which the utility operates.
|
--kubeconfig |
Paths to a kubeconfig. Only
required if out-of-cluster.
|
--log-level |
The command log
level.
|
--log-backtrace-at traceLocation |
When logging hits line file:N,
emit a stack trace.
|
--log-dir |
If non-empty, write log files in
this directory.
|
--log-file |
If non-empty, use this log
file.
|
--log_file_max_size |
The maximum size, in MB, that a
log file can grow to. If you specify 0, the maximum file size is
unlimited.
|
--logtostderr |
Log to standard error instead of
files.
|
--namespace
|
The namespace where OADP is
installed.
|
--one-output |
Specifies whether to only write
logs to their native severity level.
|
--skip-headers |
Specifies whether to avoid header
prefixes in log messages.
|
--skip-log-headers |
Specifies whether to avoid header
prefixes when opening log files.
Note: This option has no effect when
--logtostderr=true. |
--stderrthreshold severity |
Logs at or above the specified
threshold. Go to stderr when writing to files and stderr.
|
--v
|
Number for the log level
verbosity.
|
--verbose |
Logs include more detailed
messages.
|
--vmodule moduleSpec |
Comma-separated list of pattern=N
settings for file-filtered logging.
|
Examples
It is strongly recommended that you use a script to create environment variables with the correct values for your environment. For more information, see Setting up installation environment variables.
- Run backup precheck.
-
cpd-cli oadp backup precheck \ --tenant-operator-namespace ${PROJECT_CPD_INST_OPERATORS} \ --include-checks=EdbClustersInSync \ --edb-sync-retries 10 \ --edb-sync-retry-wait-duration 2s \ --verbose - Run backup precheck, excluding checking that EDB Postgres clusters are in sync.
-
cpd-cli oadp backup precheck \ --tenant-operator-namespace ${PROJECT_CPD_INST_OPERATORS} \ --exclude-checks=EdbClustersInSync --verbose