A newer version of this documentation is available.

View Latest

cbbackupmgr list

    +

    Lists the contents of the backup archive

    SYNOPSIS

    cbbackupmgr list [--archive <archive_dir>] [--repo <repo_name>]
                     [--backup <bucket_list>] [--bucket <bucket>]

    DESCRIPTION

    Lists the contents of the backup archive. The size in bytes and number of items is listed for each backup. For each directory the cumulative size of all data contained in that directory is listed. The flags for this command are used to see various sections of the backup archive.

    OPTIONS

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

    Required

    -a,--archive <archive_dir>

    The location of the backup archive to list.

    Optional

    -r,--repo <repo_name>

    If specified, the list command will only list the contents of this backup repository.

    --backup <backup>

    If specified, the list command will only list the contents of this backup. The --repo flag must also be specified if this flag is used.

    --bucket <bucket>

    If specified, the list command will only list the contents of this bucket. The --repo and --backup flags must also be specified if this flag is used.

    EXAMPLES

    The list command will display the contents of the backup archive. Below we take an example of a backup archive that has two backup repositories, example1 and example2. The example1 backup repository will contain one backup and the example2 repository will contain two backups. Below are a few examples of how the list command can be used.

    The example below shows how to list the entire backup archive. The output for this operation can be large if there are a lot of backups in the backup archive.

    $ cbbackupmgr list -a /tmp/backup --details
    Size      Items          Name
    305.58MB  -              /
    51.02MB   -              + example1
    51.02MB   -                  + 2016-03-03T11_50_36.699703253-08_00
    51.02MB   -                      + gamesim-sample
    301B      0                          bucket-config.json
    51.02MB   586                        + data
    51.02MB   586                            shard_0.fdb
    2B        0                          full-text.json
    252B      0                          gsi.json
    501B      1                          views.json
    254.56MB  -              + example2
    154.44MB  -                  + 2016-03-03T11_48_41.773621864-08_00
    55.76MB   -                      + beer-sample
    298B      0                          bucket-config.json
    55.75MB   7303                       + data
    55.75MB   7303                           shard_0.fdb
    2B        0                          full-text.json
    9.99KB    8                          gsi.json
    784B      1                          views.json
    98.69MB   -                      + travel-sample
    300B      0                          bucket-config.json
    98.68MB   31591                      + data
    98.68MB   31591                          shard_0.fdb
    2B        0                          full-text.json
    9.99KB    8                          gsi.json
    1.72KB    1                          views.json
    100.12MB  -                  + 2016-03-03T11_50_01.863827072-08_00
    50.06MB   -                      + beer-sample
    298B      0                          bucket-config.json
    50.05MB   5                          + data
    50.05MB   5                              shard_0.fdb
    2B        0                          full-text.json
    9.99KB    8                          gsi.json
    784B      1                          views.json
    50.06MB   -                      + travel-sample
    300B      0                          bucket-config.json
    50.05MB   5                          + data
    50.05MB   5                              shard_0.fdb
    2B        0                          full-text.json
    9.99KB    8                          gsi.json
    1.72KB    1                          views.json

    From the output we can see the entire contents of the backup archive and even more importantly we can see the sizes of the backups and the amount of items backed up. The data folder contains the data files and lists the size of those files and the number of documents that were backed up. The data is kept in shard files and in this example there is only one shard file, but depending on the way the backup is taken there may be more of these. In the full-text.json, views.json, and gsi.json files the item counts refer to the number of index definitions backed up.

    Since the output for listing the entire backup archive can be long, the list command provides ways to look only at specific portions of the backup archive. For example, if we only want to see the example1 backup repository we can do the following:

    $ cbbackupmgr list -a /tmp/backup -r example1
    Size      Items          Name
    51.02MB   -              + example1
    51.02MB   -                  + 2016-03-03T11_50_36.699703253-08_00
    51.02MB   -                      + gamesim-sample
    301B      0                          bucket-config.json
    51.02MB   586                        + data
    51.02MB   586                            1 Shard
    2B        0                          full-text.json
    252B      0                          gsi.json
    501B      1                          views.json

    The results can further be filtered in order to look at a specific bucket in a specific backup. To see the travel-sample bucket in the backup taken at 2016-03-03T11_50_01.863827072-08_00 from the example2 backup repository you would run the list command as follows:

    $ cbbackupmgr list -a /tmp/backup -r example2 \
     --backup 2016-03-03T11_50_01.863827072-08_00 --bucket travel-sample
    Size      Items          Name
    50.06MB   -              + travel-sample
    300B      0                  bucket-config.json
    50.05MB   5                  + data
    50.05MB   5                      shard_0.fdb
    2B        0                  full-text.json
    9.99KB    8                  gsi.json
    1.72KB    1                  views.json

    DISCUSSION

    The list command is mainly used to explore your data and understand what your backup structure looks like. This alleviates the need for users to traverse the folder structure manually to infer information about their data.

    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.

    CBBACKUPMGR

    Part of the cbbackupmgr suite