.sqlcount

Onesimus extension

Count catalog records.

Synopsis

.sqlcount [table=<table>] [catalog=<catalog>]

Words without brackets are required, [ ] marks optional parts, a | b alternatives, ... a repeatable argument and [,...] a comma separated list.

Description

Counts the rows of catalog tables. Without an argument it reports the most important tables (client, fileset, job, jobmedia, media, pool, storage); File and Path are left out on purpose because counting them takes long in large catalogs. With table= exactly one table is counted. The command only reads.

Onesimus extension: Bareos does not know the command and answers “.sqlcount: is an invalid command.”, so programs that must work with both directors should not rely on it. The console needs .sql or sqlquery in its Command ACL in addition to .sqlcount.

Arguments

ArgumentTypeValues / sourceDefaultFlagsDescription
table=stringTable name.
catalog=resourcefrom .catalogsCatalog name.

Examples

Row counts of the main catalog tables:

.sqlcount

Number of rows in the file table:

.sqlcount table=file

See also

Command reference