Size#

Checker name#

File size check

Description#

Checks the size of a restored file-system object. The current value is read from the restored path using the file-system size reported by PHP.

The checker can compare the restored size with a manually configured value or with the size stored in the Bacula Catalog.

Attribute#

Size

Selecting the Size attribute in Verification Rules causes Bacularis to execute the FileSizeCheck checker.

Supported operators#

  • < - less than

  • <= - less than or equal to

  • == - equal to

  • != - not equal to

  • > - greater than

  • >= - greater than or equal to

  • C== - equal to the value stored in the Bacula Catalog

C== is the user-facing Catalog comparison operator. Internally, the checker identifies this operation as Equal Catalog Value.

Expected value#

For the standard comparison operators, enter the expected size in bytes.

When C== is used, the expected value is taken automatically from the Bacula Catalog and does not need to be entered manually.

Capabilities#

This checker requires a Restore Destination with the File restore checks capability enabled.

Requirements#

No additional requirements.

Examples#

Verify that a restored file is not empty:

/opt/bacula/bin/bdirjson  Size  >  0

Verify that a file has exactly 1024 bytes:

/data/example.bin  Size  ==  1024

Compare the restored file size with the value stored in the Bacula Catalog:

/opt/bacula/bin/bdirjson  Size  C==  Catalog value

Notes and limitations#

If the selected path does not exist, the check fails.

Directory sizes are file-system dependent. For predictable results, this checker is primarily useful for regular files and symbolic links.

For symbolic links, the checker verifies the size of the symbolic link itself, not the size of its target.