The nzbatchbnr command

Use the nzbatchbnr command to run batch operations for backup and radm_cloud_nzbatchbnradm_cloud_nzbatchbnradm_cloud_nzbatchbnrestore.
With the command, you can do the following actions:
  • Trigger a batch of backups of all existing databases.
  • Trigger a partial or complete restore of selected or all databases from a batch.
  • Delete backups from cloud stores.
  • List all backup and restore batch operations.
  • Get the status of ongoing batch operations.
  • Get information about errors that you encountered during a batch.
  • Scan backups on cloud and recover metadata about backups, use it for recovery or migration.

Syntax

The nzbatchbnr has the following syntax:
nzbatchbnr [operation] --destination [ s3 | ibm | az ] --unique-id UNIQUE ID CONNECTION ARGUMENTS
Table 1. The nzbatchbnr command operations
Operation type Command syntax  
Backup
nzbatchbnr backup [--j JSON FILE| -J JSON STRING]
JSON format for a backup
'{"backup_list":[{"db":[{"name":"*"}],"type":"FULL","label":{"batchtype":"ADHOC","bucket":"dev-bnr-bucket"}}]}'
JSON format for a backup of single database and no schema
'{"backup_list":[{"db":[{"name":"DB1"}],"type":"FULL","label":{"batchtype":"ADHOC","bucket":"dev-bnr-bucket"}}]}'
JSON format for a backup of multiple databases and multiple schemas
'{"backup_list":[{"db":[{"name":"DB1","schemas":["SCHEMA_NAME_1","SCHEMA_NAME_2"]},{"name":"DB2","schemas":["SCHEMA_NAME_3","SCHEMA_NAME_4"]}],"type":"FULL","label":{"batchtype":"ADHOC","bucket":"dev-bnr-bucket"}}]}'
--j
Specifies a JSON file for the backup.
-J
Specifies a JSON string for the backup.
Restore
nzbatchbnr restore [--j JSON FILE| -J JSON STRING]
JSON format for restoring a batch
'{"batchid": "<batchid>","select": {},"user_name" : "*", "token" : "*"}'
JSON format for restoring select databases from a batch
'{"batchid": "<batchid>","select": {"DB1":{},"DB2":{}},"user_name" : "*", "token" : "*"}'
JSON format for restoring select tables from select databases from a batch
'{"batchid": "<batchid>","select": {"DB1":{"schemas":{"ADMIN":["T1","T2"]}}},"user_name" : "*", "token" : "*"}'
--j
Specifies a JSON file for the restore.
-J
Specifies a JSON string for the restore.
List
nzbatchbnr ls [subcommands]
no subcommand specified
Lists all backups and restore batches.
-b BATCH ID
Returns the status of a batch.
scan-cloud [options]
Note: In earlier releases, scan-cloud was called scan-s3. That option is now discontinued. scan-cloud must be used instead.
List of options:
--all
Scans all namespaces from a specified destination.
--scan-tables
Scans the backups for a table count. Applicable only for S3/IBM Cloud, works by default for Azure blob storage.
--print-only
Prints whether a new entry is an insert one (I), updated one (U) or there is no change (X).
Delete
delete [-b LIST OF BATCHES | -f, --force_catalog_delete]
-b
Deletes specified batches.

You must separate the batches with a comma.

-f, --force_catalog_delete
Deletes a specified batch-id from catalog.
Errors
errors -b <batch>
  • If the command is successful, the status is SUCCESSFUL and the message is Operation Done.

  • If the command is not successful, the status is ERROR and the message is FAILED DATABASE NAME. For DATABASE NAME, an actual name of the database and a timestamp are provided.
 
Example:
{
  "backup_list": [
    {
      "db": [
        {
          "name": "DB1"
        }
      ],
      "type": "FULL",
      "label": {
        "batchtype": "ADHOC",
        "bucket": "concerto-bnr-test-qa"
      }
    }
  ]
}
{
  "batchid": "20251029082815",
  "select": {},
  "user_name": "admin",
  "token": "**********"
}
Table 2. The nzbatchbnr command connection arguments
Destination type Connection arguments
s3
--access-key
Specifies the access key.
--secret-key
Specifies the secret key.
--region
Specifies the region in which the bucket is.
--bucket
Specifies the bucket that you want to use.
ibm
--access-key
Specifies the access key.
--secret-key
Specifies the secret key.
--region
Specifies the region in which the bucket is.
--bucket
Specifies the bucket that you want to use.
--endpoint
Specifies the endpoint type.
az
--account-name
Specifies the account name.
--account-key
Specifies the account key.
--container
Specifies the container name.
Connection arguments can be mentioned in a credentials file, in the --creds-file option. The format of the credentials file is:
{
    "access_key_id": "",
    "default_region": "",
    "bucket": "",
    "secret_key": "",
    "endpoint": "",
    "user_name": "",
    "token": "",
    "account_name": "",
    "account_key": "",
    "container": "",
    "destination": ""
}
Note: The destination key is mandatory in the --creds-file option.
The key takes the following values:
  • AWS_S3
  • IBMCLOUD_OBJECT
  • AZURE_BLOB

An empty value is not allowed.