List and Query

Enterprise

Bacula Enterprise Only

This solution is only available for Bacula Enterprise. For subscription inquiries, please reach out to sales@baculasystems.com.

The HDFS Plugin can list snapshottable directories and query snapshot contents.

Command Overview

  • q_json_pretty=yes formats query output as pretty-printed JSON.

The backend understands two query targets:

  • directory to inspect snapshottable directories

  • snapshot:<path> to inspect the snapshots under a directory

Directory Listing Output

A directory listing returns entries with the following keys:

  • directory

  • snapshotNumber

  • quota

  • parent

Example output:

.query client=bacula-hdfs-fd plugin="hdfs: config_file=/opt/bacula/etc/hdfs.conf" parameter=directory
directory=myDir1
snapshotNumber=2
quota=64
parent=/
directory=myDir2
snapshotNumber=2
quota=64
parent=/

Snapshot Listing Output

A snapshot listing returns entries with the following keys:

  • snapshot

  • name

  • path

  • blocksize

  • mtime

  • len

  • owner

  • group

Example output:

.query client=bacula-hdfs-fd plugin="hdfs: config_file=/opt/bacula/etc/hdfs.conf" parameter=snapshot:hdfs-regress-test
snapshot=/hdfs-regress-test/.snapshot/bsnap_TestJob.2020-01-31_11.33.55_03
name=bsnap_TestJob.2020-01-31_11.33.55_03
path=/hdfs-regress-test/.snapshot/bsnap_TestJob.2020-01-31_11.33.55_03
blocksize=134217728
mtime=1717760000000
len=0
owner=hadoop
group=supergroup

Typical Uses

  • Identify which directories are snapshottable before enabling a backup job.

  • Inspect the snapshot inventory for a given directory.

See also

Previous articles:

Go back to: Operations.