List Backups

This section explains how to list all existing backups for a given database.

This procedure can be carried out using the Administration API or ConfD.

Prerequisites

There are no prerequisites for this procedure.

Procedure - Administration API

The following examples use curl in a Linux terminal to send REST calls to endpoints in the Administration API. You can also use other interfaces and languages to interact with the API. For more information, see Administration API.

Placeholder values are styled as Bash variables, for example: $NODE_IP. Replace the placeholders with your own values.

  1. To get information about the database, send a GET request to the /api/v1/databases endpoint.

    curl --insecure -X "GET" \
    "https://$NODE_IP:4444/api/v1/databases" \
    -H "accept: application/json" \
    -H "Authorization: Basic $AUTH_TOKEN"

    The response includes the database ID, name, and version. Additional details are included depending on the configuration and platform.

  2. To get information about all existing backups for the current database, send a GET request to the /api/v1/databases/DATABASE_ID/backups/ endpoint. For example:

    curl --insecure -X "GET" \
    "https://$NODE_IP:4444/api/v1/databases/$DATABASE_ID/backups" \
    -H "accept: application/json" \
    -H "Authorization: Basic $AUTH_TOKEN"

    If the backup was taken from another database than the one you are currently connected to, it is said to have been taken on a foreign database. Backups taken on foreign databases cannot be listed using the Administration API. In this case you must use ConfD.

Procedure - ConfD

The following examples use ConfD through the command-line tool confd_client, which is available on all database nodes. For more information, see ConfD.

Placeholder values are indicated with UPPERCASE characters. Replace the placeholders with your own values.

  1. Connect to EXAClusterOS (COS) using c4 connect -t <DEPLOYMENT>[.<NODE>]/cos. For example:

    c4 connect -t 1/cos

    In most cases it does not matter on which node you access ConfD. If you do not specify a node, c4 will connect to the first active node in the deployment. The command prompt in COS indicates which node you are connected to:

    [root@n11 ~]#

    For more information about how to use c4 connect, see How to use c4.

  2. To find the name of the database, use the ConfD job db_list. For example:

    confd_client db_list
    - MY_DATABASE
  3. To get information about all backups for the current database, use the ConfD job db_backup_list. For example:

    confd_client db_backup_list db_name: MY_DATABASE

    - bid: 1
      comment: ''
      dependencies: '-'
      expire: 2024-06-20 12:08
      expire_alterable: 10001 MY_DATABASE/id_1/level_0
      expired: false
      id: 10001 MY_DATABASE/id_1/level_0/node_0/backup_202406131208 MY_DATABASE
      last_item: true
      level: 0
      path: MY_DATABASE/id_1/level_0/node_0/backup_202406131208
      system: MY_DATABASE
      timestamp: 2024-06-13 12:08
      ts: '202406131208'
      usable: true
      usage: 0.011 GiB
      volume: r0001

    List foreign databases

    If the backup was taken from another database than the one you are currently connected to, it is said to have been taken on a foreign database. To list backups that were taken on foreign databases as well as backups taken on the current database, use the ConfD job db_backup_list with the show_foreign parameter set to True.

    confd_client db_backup_list db_name: MY_DATABASE show_foreign: True