LinuxCommandLibrary

bcomps

Compare binary files part by part

TLDR

Decompose one or more graphs into their biconnected components

$ bcomps [path/to/input1.gv path/to/input2.gv ...] > [path/to/output.gv]
copy

Print the number of blocks and cutvertices in one or more graphs
$ bcomps -v -s [path/to/input1.gv path/to/input2.gv ...]
copy

Write each block and block-cutvertex tree to multiple numbered filenames based on output.gv
$ bcomps -x -o [path/to/output.gv] [path/to/input1.gv path/to/input2.gv ...]
copy

Display help
$ bcomps -?
copy

SYNOPSIS

bcomps [-c config_file] [-s] [-v] volume1 volume2

PARAMETERS

-c config_file
    Specifies the Bacula configuration file to use. If not provided, bcomps will try to locate a default configuration file, typically 'bconsole.conf'.

-s
    Suppresses normal output, showing only a brief summary of the comparison results. Useful for scripting or quick checks.

-v
    Enables verbose output, providing more detailed information during the comparison process, such as each file being compared.

volume1
    The name of the first Bacula volume to be compared.

volume2
    The name of the second Bacula volume to be compared.

DESCRIPTION

bcomps is a utility program provided as part of the Bacula backup system. Its primary function is to compare the contents of two specified Bacula volumes. This comparison is done at the file level, identifying whether files on both volumes match, differ, or exist on one volume but not the other.

This command is particularly useful for verifying the integrity of copied volumes (e.g., from disk to tape or between different storage locations), for auditing purposes, or for ensuring that a disaster recovery replica is identical to its source. It helps administrators quickly pinpoint discrepancies between two backup sets.

It operates by reading the file metadata and data on both volumes and reporting any inconsistencies. It's a non-destructive operation, meaning it only reads the volumes and does not modify their contents. The output typically lists files that are identical, different, or unique to one of the volumes.

CAVEATS

The bcomps utility is specific to Bacula volumes and cannot be used to compare arbitrary files or other backup formats. It requires access to the Bacula catalog database or appropriate configuration to interpret volume data correctly.

The comparison can be resource-intensive for very large volumes, requiring significant I/O operations. Ensure that the Bacula Storage Daemon has access to both volumes.

TYPICAL USE CASES

bcomps is frequently used in scenarios where data integrity and verification are paramount:

  • Verification of Volume Copies: After copying a Bacula volume (e.g., tape to tape, disk to disk), bcomps can confirm that the copy is bit-for-bit identical to the original.
  • Auditing and Compliance: For regulatory compliance, it can provide proof that two backup sets contain the same data at a specific point in time.
  • Disaster Recovery Testing: Helps ensure that a restored dataset from one volume matches the original data from another volume, verifying the recovery process.

HOW IT WORKS

bcomps interacts with the Bacula Storage Daemon and potentially the Bacula Catalog (database) to access and interpret the data on the specified volumes. It reads the file records from each volume, comparing attributes like filename, size, checksums, and modification times. For a thorough comparison, it might also read and compare file data blocks directly. Discrepancies are reported to the standard output.

HISTORY

The bcomps command is an integral part of the Bacula backup system, an open-source enterprise-ready backup solution. Bacula was originally developed by Kern Sibbald, with the first public release in 2002. Utilities like bcomps were developed alongside the core system to provide essential functionalities for managing and verifying backup data, evolving with the Bacula project over the years to improve efficiency and feature sets for robust data management.

SEE ALSO

bscan(8), bextract(8), bconsole(8), diff(1)

Copied to clipboard