cbbackupmgr compact

cbbackupmgr compact

Name

cbbackupmgr-compact - Compacts a backup to free disk space

Synopsis

cbbackupmgr compact [--archive <archive_dir>] [--repo <repo_name>] [--backup <backup_name>]

Description

Compacts a backup in a backup repository in order to free up disk space. Should be run on each backup after it completes. The amount of freed disk space is displayed when the compaction completes.

Options

Below are a list of parameters for the compact command.

Required

--archive <archive_dir>

  • The location of the archive directory.

--repo <repo_name>

  • The name of the backup repository where the backup to be compacted is located.

--backup <backup_name>

  • The name of the backup to compact.

Examples

The compact command is used to compact backups in order to free disk space and should be run after each backup. Below is an example of how to run the compaction command. The /data/backup directory is used as the archive directory and the backup repository is named "example".

$ cbbackupmgr config --archive=/data/backup --repo=example 
 
$ cbbackupmgr backup --archive /data/backup --repo example \ 
--host 127.0.0.1:8091 --username Administrator --password password 
 
$ cbbackupmgr list --archive /data/backup 
Size      Items          Name 
91.52MB   -              / 
91.52MB   -              + example 
91.52MB   -                  + 2016-02-12T12_45_33.329408761-08_00 
91.52MB   -                      + travel-sample 
322B      0                          bucket-config.json 
91.51MB   31569                      + data 
91.51MB   31569                          shard_0.fdb 
2B        0                          full-text.json 
10.00KB   8                          gsi.json 
1.72KB    1                          views.json 
 
$ cbbackupmgr compact --archive /data/backup --repo example \ 
--backup 2016-02-12T12_45_33.329408761-08_00 
 
Compaction succeeded, 58589184 bytes freed 

Discussion

The compact command can be run after a backup to reclaim any fragmented disk space in the backup data files. It should be noted however that compaction may be run during the backup itself if the fragmentation in the data file begins to grow too big. Although the compaction can run during the backup it is not guaranteed to be run once the backup has completed, hence the reason for the compact command.

Environment And Configuration Variables

(None)

Files

shard-*.fdb

  • The compact command will compact all shard-*.fdb files in the backup specified by the compact command.