cbbackupmgr info

    +

    Return information about the backup archive

    SYNOPSIS

    cbbackupmgr info [--archive <archive_dir>] [--repo <repo_name>]
                     [--backup <bucket_list>] [--bucket <bucket>]
                     [--json] [--all] [--obj-access-key-id <access_key_id>]
                     [--obj-cacert <cert_path>] [--obj-endpoint <endpoint>]
                     [--obj-no-ssl-verify] [--obj-region <region>]
                     [--obj-staging-dir <staging_dir>]
                     [--obj-secret-access-key <secret_access_key>]
                     [--s3-force-path-style] [--s3-log-level <level>]

    DESCRIPTION

    This command provides information about the given path, be it the whole archive, repository, backup or bucket. The information can be displayed in a tabular format or JSON. By default only two levels of the data hierarchy will be displayed in tabular format, to see it all use the --all flag. For the exact format of the output please see the examples below. Unlike the list command this command will not list individual files.

    OPTIONS

    Below are the required and optional parameters for the info command.

    Required

    -a,--archive <archive_dir>

    The location of the backup archive to display information about. When using info against an archive stored in S3 you must prefix the archive path with s3://${BUCKET_NAME}/.

    Optional

    -r,--repo <repo_name>

    If specified, the info command will only display information for this backup repository.

    --backup <backup>

    If specified, the info command will only display information for this backup. The --repo flag must also be specified if this flag is used.

    --bucket <bucket>

    If specified, the info command will only display information for this bucket. The --repo and --backup flags must also be specified if this flag is used.

    --json

    If specified the output will be a json object.

    --all

    Show all levels of the data hierarchy. Note that for json output all levels are always returned.

    Cloud integration

    Required

    --obj-staging-dir <staging_dir>

    When performing an operation on an archive which is located in the cloud such as AWS, the staging directory is used to store local meta data files. This directory can be temporary (it’s not treated as a persistent store) and is only used during the backup. NOTE: Do not use /tmp as the your obj-staging-dir. See Disk requirements in cbbackupmgr-cloud for more information.

    Optional

    --obj-access-key-id <access_key_id>

    The access key id which has access to your chosen object store. This option can be omitted when using the shared config functionality provided by your chosen object store. Can alternatively be provided using the CB_OBJSTORE_ACCESS_KEY_ID environment variable.

    --obj-cacert <cert_path>

    Specifies a CA certificate that will be used to verify the identity of the object store being connected to.

    --obj-endpoint <endpoint>

    The host/address of your object store.

    --obj-no-ssl-verify

    Skips the SSL verification phase when connecting to the object store. Specifiying this flag will allow a connection using SSL encryption, but you are vulnerable to a man-in-the-middle attack.

    --obj-region <region>

    The region in which your bucket/container resides. For AWS this option may be omitted when using the shared config functionality. See the AWS section of the cloud documentation for more information.

    --obj-secret-access-key <secret_access_key>

    The secret access key which has access to you chosen object store. This option can be omitted when using the shared config functionality provided by your chosen object store. Can alternatively be provided using the CB_OBJSTORE_SECRET_ACCESS_KEY environment variable.

    AWS S3 Options

    Optional
    --s3-force-path-style

    By default the updated virtual style paths will be used when interfacing with AWS S3. This option will force the AWS SDK to use the alternative path style URLs which are often required by S3 compatible object stores.

    --s3-log-level <level>

    Set the log level for the AWS SDK. By default logging will be disabled. Valid options are debug, debug-with-signing, debug-with-body, debug-with-request-retries, debug-with-request-errors, and debug-with-event-stream-body.

    EXAMPLES

    The info command will display information of the backup archive in a user friendly manner. Let’s imagine we have a backup archive /backup_archive and we want to see information about it we would run the command:

    $ cbbackupmgr info -a /backup_archive
    
    Name             | Size      | # Repos  |
    backup_archive   | 111.00MB  | 2        |
    
    *    Name        | Size     | # Backups  |
    *    Manchester  | 55.56MB  | 1          |
    *    London      | 55.44MB  | 2          |

    This shows us that the archive backup_archive has two repositories and has a total size of 110MB. It will also provide one level more into the hierarchy and show information of the two repositories Manchester and London and we can see their respective sizes as well as the number of backups each contains.

    If we wanted to get more in depth information of the repository we would provide the repository name as follows:

    $cbbackupmgr info -a ~/backup_archive -r London
    
    Name    | Size     | # Backups  |
    London  | 55.44MB  | 2          |
    
    +  Backup                       | Size     | Type  | Source                 | Range  | Events  | Aliases  | Complete  |
    +  2019-03-15T13_19_54.826458Z  | 3.02MB   | INCR  | http://localhost:8091  | N/A    | 0       | 1        | true      |
    +  2019-03-15T12_18_00.514284Z  | 52.42MB  | FULL  | http://localhost:8091  | N/A    | 0       | 1        | true      |

    This gives more in depth information about each backup such as the timestamp from when it was made, the size, the type which can be either a full backup (FULL), and incremental backup (INCR) or a merge (MERGE). We can also see the address of the cluster we backed up the data from. The range column is used by merges. If the backup is a merge the range has the start timestamp the end timestamp and the number of backups that where merge in the format start - end : count. Event and aliases are the number of events and full text search indexes aliases that where restored. Finally the complete field indicates if the backup finished successfully or not.

    It is possible to get information for an individual backup as well by using the following command:

    $ cbbackupmgr info -a ~/backup_archive -r London --backup 2019-03-15T12_18_00.514284Z
    
    Backup                       | Size     | Type  | Source                 | Range  | Events  | Aliases  | Complete  |
    2019-03-15T12_18_00.514284Z  | 52.42MB  | FULL  | http://localhost:8091  | N/A    | 0       | 1        | true      |
    
     -   Bucket          | Size     | Items  | Mutations | Tombstones | Views  | FTS  | Indexes  | CBAS  |
     -   beer-sample     | 6.85MB   | 7303   | 7303      | 0          | 1      | 0    | 1        | 0     |
     -   gamesim-sample  | 2.86MB   | 586    | 586       | 0          | 1      | 0    | 1        | 0     |
     -   travel-sample   | 42.72MB  | 31591  | 31591     | 0          | 0      | 0    | 10       | 0     |

    The command above provides information about all buckets in the specific backup. This includes the size of the data in each bucket, the number of items which includes mutations and tombstones, the number of mutations and the number of deletions. For backups made with cbbackupmgr older than 6.5 mutations and deletions will always be 0 as this is only supported by archives made with cbbcakupmgr 6.5+. For the buckets it will also shows the number of view, full text indexes, the number of GSIs and the number of analytics metadata records.

    To see information for one bucket only we would use the --bucket flag and give it the name of the bucket and this would return just the information for that bucket.

    To see from one level to the last the --all flag must be provided this will show the information from the provided level to the bucket level. An example can be seen below:

    $ cbbackupmgr info -a ~/backup_archive --all
    
    Name         | UUID                                 | Size     | # Repos  |
    backup_repo  | 32c97d5f-821a-4284-840b-9ee7cf8733a3 | 55.56MB  | 1        |
    
    *  Name        | Size     | # Backups  |
    *  Manchester  | 55.56MB  | 1          |
    
    +    Backup                      | Size     | Type   | Source  | Cluster UUID                     | Range                                      | Events  | Aliases  | Complete  |
    +    2019-03-15T13_52_27.18301Z  | 55.56MB  | MERGE  | MERGE   | c044f5eeb1dc16d0cd49dac29074b5f9 | 2019-03-15T13_51_44-2019-03-15T13_51_58:3  | 0       | 1        | true      |
    
    -      Bucket          | Size     | Items  | Mutations | Tombstones | Views  | FTS  | Indexes  | CBAS  |
    -      beer-sample     | 6.85MB   | 7303   | 7303      | 0          | 1      | 0    | 1        | 0     |
    -      gamesim-sample  | 2.86MB   | 586    | 586       | 0          | 1      | 0    | 1        | 0     |
    -      travel-sample   | 42.72MB  | 31591  | 31591     | 0          | 0      | 0    | 10       | 0     |

    The info command also allows for JSON output which can be useful for automation or users that would rather get the information in json format. The output json will have the format seen below. Note that all sizes will be in bytes and that for non-merge backups the range field will be empty.

    {
      "name": NAME,
      "archive_uuid": UUID,
      "size": SIZE,
      "repos": [
        {
          "name": NAME,
          "size": SIZE,
          "count": BACKUP_COUNT,
          "backups": [
            {
              "date": DATE,
              "complete: BOOL
              "size": SIZE,
              "type": ["incr"| "full" | "merge"],
              "source": SOURCE,
              "range":[all backups date involved in the merge],
              "event": COUNT,
              "fts_alias": COUNT,
              "source_cluster_uuid": UUID,
              "buckets": [
                {
                  "name": BUCKET_NAME,
                  "size": SIZE,
                  "items": COUNT,
                  "mutations": COUNT,
                  "tombstones": COUNT,
                  "views_count": COUNT,
                  "fts_count": COUNT,
                  "analytics": COUNT
                }
              ]
            }
          ]
        }
      ]

    The info command also supports getting information about an archive which is stored directly in AWS S3. This will download a very minimal amount of data e.g. it won’t download the whole archive.

    $ cbbackupmgr info -a s3://bucket/backup_archive --all --obj-staging-dir ~/backup-archive
    
    Name         | UUID                                 | Size     | # Repos  |
    backup_repo  | 32c97d5f-821a-4284-840b-9ee7cf8733a3 | 55.56MB  | 1        |
    
    *  Name        | Size     | # Backups  |
    *  Manchester  | 55.56MB  | 1          |
    
    +    Backup                      | Size     | Type   | Source  | Cluster UUID                     | Range                                      | Events  | Aliases  | Complete  |
    +    2019-03-15T13_52_27.18301Z  | 55.56MB  | MERGE  | MERGE   | c044f5eeb1dc16d0cd49dac29074b5f9 | 2019-03-15T13_51_44-2019-03-15T13_51_58:3  | 0       | 1        | true      |
    
    -      Bucket          | Size     | Items  | Mutations | Tombstones | Views  | FTS  | Indexes  | CBAS  |
    -      beer-sample     | 6.85MB   | 7303   | 7303      | 0          | 1      | 0    | 1        | 0     |
    -      gamesim-sample  | 2.86MB   | 586    | 586       | 0          | 1      | 0    | 1        | 0     |
    -      travel-sample   | 42.72MB  | 31591  | 31591     | 0          | 0      | 0    | 10       | 0     |

    ENVIRONMENT AND CONFIGURATION VARIABLES

    CB_ARCHIVE_PATH

    Specifies the path to the backup archive. If the archive path is supplied as a command line argument then this value is overridden.

    CB_OBJSTORE_STAGING_DIRECTORY

    Specifies the path to the staging directory. If the --obj-staging-dir argument is provided in the command line then this value is overridden.

    CB_OBJSTORE_REGION

    Specifies the object store region. If the --obj-region argument is provided in the command line then this value is overridden.

    CB_OBJSTORE_ACCESS_KEY_ID

    Specifies the object store access key id. If the --obj-access-key-id argument is provided in the command line this value is overridden.

    CB_OBJSTORE_SECRET_ACCESS_KEY

    Specifies the object store secret access key. If the --obj-secret-access-key argument is provided in the command line this value is overridden.

    CB_AWS_ENABLE_EC2_METADATA

    By default cbbackupmgr will disable fetching EC2 instance metadata. Setting this environment variable to true will allow the AWS SDK to fetch metadata from the EC2 instance endpoint.

    CBBACKUPMGR

    Part of the cbbackupmgr suite