Catalog resource

The Catalog resource describes the PostgreSQL database that holds the job, file and volume records.

Examples

The catalog on the local PostgreSQL server

Catalog {
  Name = MyCatalog
  DB Name = bareos
  DB User = bareos
  DB Password = "db-secret"
}

Directives

DirectiveTypeDefaultSummary
NamenamerequiredName of the catalog; Client and Pool resources and the use command refer to it.
DescriptionstringFree text describing the catalog.
DB AddressstringHost of the PostgreSQL server; without it (and without DB Socket) the local socket is used.
DB Portpositive integerTCP port of the PostgreSQL server.
DB PasswordpasswordPassword of the database user.
DB UserstringrequiredDatabase user the Director connects as.
DB NamestringrequiredName of the catalog database.
DB SocketstringDirectory of the PostgreSQL Unix socket, instead of a TCP connection.
Multiple Connectionsyes|nodeprecatedDeprecated: use several database connections.
Disable Batch Insertyes|nonodeprecatedDeprecated: insert file records one by one instead of in batches.
Reconnectyes|noyesReconnect automatically when the database connection breaks.
Exit On Fatalyes|nonoStop the Director on a fatal database error instead of carrying on.
Min Connectionspositive integer1Connections the connection pool opens at start.
Max Connectionspositive integer5Upper limit of the connection pool.
Inc Connectionspositive integer1How many connections the pool opens at once when it grows.
Idle Timeoutpositive integer30Seconds after which an idle pooled connection is closed.
Validate Timeoutpositive integer120Seconds after which a pooled connection is checked before use.
Db DriverstringpostgresqlOnesimusOnesimus extension: accepted so that older configurations that still name the driver load; Bareos 25 removed the directive.

Name

Key: name · Type: name · Required

Name of the catalog; Client and Pool resources and the use command refer to it.

Catalog {
  Name = "MyCatalog"
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos

Description

Key: description · Type: string

Free text describing the catalog.

Catalog {
  Name = MyCatalog
  Description = "Main catalog"
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos description="Main catalog"

DB Address

Key: dbaddress · Type: string · Aliases: Address

Host of the PostgreSQL server; without it (and without DB Socket) the local socket is used.

Catalog {
  Name = MyCatalog
  DB Address = "db.example.com"
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos dbaddress=db.example.com

DB Port

Key: dbport · Type: positive integer · Aliases: Port

TCP port of the PostgreSQL server.

Catalog {
  Name = MyCatalog
  DB Port = 5432
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos dbport=5432

DB Password

Key: dbpassword · Type: password · Aliases: Password

Password of the database user. The Onesimus Director masks it in show as sixteen asterisks (****************).

Catalog {
  Name = MyCatalog
  DB Password = "db-secret"
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos dbpassword=db-secret

DB User

Key: dbuser · Type: string · Aliases: User · Required

Database user the Director connects as.

Catalog {
  Name = MyCatalog
  DB User = "bareos"
}

In the console:

configure add catalog name=MyCatalog dbname=bareos dbuser=bareos

DB Name

Key: dbname · Type: string · Required

Name of the catalog database.

Catalog {
  Name = MyCatalog
  DB Name = "bareos"
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos

DB Socket

Key: dbsocket · Type: string · Aliases: Socket

Directory of the PostgreSQL Unix socket, instead of a TCP connection.

Catalog {
  Name = MyCatalog
  DB Socket = "/var/run/postgresql"
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos dbsocket=/var/run/postgresql

Multiple Connections

Key: multipleconnections · Type: yes|no · Values: yes, no · Deprecated

Deprecated: use several database connections.

Catalog {
  Name = MyCatalog
  Multiple Connections = yes
}

Disable Batch Insert

Key: disablebatchinsert · Type: yes|no · Default: no · Values: yes, no · Deprecated

Deprecated: insert file records one by one instead of in batches.

Catalog {
  Name = MyCatalog
  Disable Batch Insert = no
}

Reconnect

Key: reconnect · Type: yes|no · Default: yes · Values: yes, no

Reconnect automatically when the database connection breaks.

Catalog {
  Name = MyCatalog
  Reconnect = yes
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos reconnect=yes

Exit On Fatal

Key: exitonfatal · Type: yes|no · Default: no · Values: yes, no

Stop the Director on a fatal database error instead of carrying on.

Catalog {
  Name = MyCatalog
  Exit On Fatal = no
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos exitonfatal=no

Min Connections

Key: minconnections · Type: positive integer · Default: 1

Connections the connection pool opens at start.

Catalog {
  Name = MyCatalog
  Min Connections = 1
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos minconnections=1

Max Connections

Key: maxconnections · Type: positive integer · Default: 5

Upper limit of the connection pool.

Catalog {
  Name = MyCatalog
  Max Connections = 5
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos maxconnections=5

Inc Connections

Key: incconnections · Type: positive integer · Default: 1

How many connections the pool opens at once when it grows.

Catalog {
  Name = MyCatalog
  Inc Connections = 1
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos incconnections=1

Idle Timeout

Key: idletimeout · Type: positive integer · Default: 30

Seconds after which an idle pooled connection is closed.

Catalog {
  Name = MyCatalog
  Idle Timeout = 30
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos idletimeout=30

Validate Timeout

Key: validatetimeout · Type: positive integer · Default: 120

Seconds after which a pooled connection is checked before use.

Catalog {
  Name = MyCatalog
  Validate Timeout = 120
}

In the console:

configure add catalog name=MyCatalog dbuser=bareos dbname=bareos validatetimeout=120

Db Driver

Key: dbdriver · Type: string · Default: postgresql · Onesimus

Onesimus extension: accepted so that older configurations that still name the driver load; Bareos 25 removed the directive. The catalog is PostgreSQL.

Catalog {
  Name = MyCatalog
  Db Driver = "postgresql"
}

See also: configuration reference, configure, show