Messages resource

A Messages resource routes the messages of jobs and daemons to destinations: the catalog (job log), mail, files, syslog or the console.

Examples

Job messages to catalog, log file and mail on errors

Messages {
  Name = Standard
  Mail Command = "/usr/bin/bsmtp -h localhost -f \"Bareos <bareos@example.com>\" -s \"Bareos: %t %e of %c %l\" %r"
  Operator Command = "/usr/bin/bsmtp -h localhost -f \"Bareos <bareos@example.com>\" -s \"Bareos: Intervention needed for %j\" %r"
  Mail On Error = admin@example.com = all, !skipped, !saved, !audit
  Operator = admin@example.com = mount
  Console = all, !skipped, !saved, !audit
  Append = "/var/log/bareos/bareos.log" = all, !skipped, !saved, !audit
  Catalog = all, !skipped, !saved, !audit
}

Directives

DirectiveTypeDefaultSummary
NamenameName of the Messages resource; Jobs, the Director and daemons refer to it.
DescriptionstringFree text describing the resource.
Mail CommandstringCommand that sends the mails of Mail, Mail On Error and Mail On Success. bsmtp is the usual choice.
Operator CommandstringCommand for Operator messages (for example mount requests); same variables as Mail Command.
Timestamp Formatstringstrftime format of the time stamps of these messages.
Syslogmessage destinationSend messages to the system log.
Mailmessage destinationMail the messages to the addresses before the second = (comma separated) when the job ends, as one mail per job.
Mail On Errormessage destinationLike Mail, but the mail is only sent when the job did not terminate normally.
Mail On Successmessage destinationLike Mail, but only for jobs that terminated normally.
Filemessage destinationWrite the messages to a file, which is overwritten when the Director starts.
Appendmessage destinationAppend the messages to a file.
Stdoutmessage destinationPrint the messages on standard output of the daemon (mostly for debugging in the foreground).
Stderrmessage destinationPrint the messages on standard error of the daemon.
Directormessage destinationSend the messages of a File or Storage Daemon to the Director named before the second =; only used in the daemons’ own Messages resources.
Consolemessage destinationKeep the messages for the consoles: they appear with the messages command (and automatically with autodisplay on).
Operatormessage destinationSend the messages to the operator addresses through Operator Command, at once rather than at the end of the job.
Catalogmessage destinationStore the messages in the catalog (table Log); the job log shown by list joblog and by the GUI comes from there.

Name

Key: name · Type: name

Name of the Messages resource; Jobs, the Director and daemons refer to it.

Messages {
  Name = "Standard"
}

In the console:

configure add messages name=Standard

Description

Key: description · Type: string

Free text describing the resource.

Messages {
  Name = Standard
  Description = "Mail errors to the admins"
}

In the console:

configure add messages name=Standard description="Mail errors to the admins"

Mail Command

Key: mailcommand · Type: string

Command that sends the mails of Mail, Mail On Error and Mail On Success. bsmtp is the usual choice. Variables such as %r (recipients), %j (job name), %t (job type), %e (exit status), %c (client) and %d (Director) are replaced.

Messages {
  Name = Standard
  Mail Command = "/usr/bin/bsmtp -h localhost -f \"Bareos <bareos@example.com>\" -s \"Bareos: %t %e of %c %l\" %r"
}

In the console:

configure add messages name=Standard mailcommand="/usr/bin/bsmtp -h localhost -f \"Bareos <bareos@example.com>\" -s \"Bareos: %t %e of %c %l\" %r"

Operator Command

Key: operatorcommand · Type: string

Command for Operator messages (for example mount requests); same variables as Mail Command.

Messages {
  Name = Standard
  Operator Command = "/usr/bin/bsmtp -h localhost -f bareos@example.com -s \"Bareos: Intervention needed for %j\" %r"
}

In the console:

configure add messages name=Standard operatorcommand="/usr/bin/bsmtp -h localhost -f bareos@example.com -s \"Bareos: Intervention needed for %j\" %r"

Timestamp Format

Key: timestampformat · Type: string

strftime format of the time stamps of these messages.

Messages {
  Name = Standard
  Timestamp Format = "%Y-%m-%d %H:%M:%S"
}

In the console:

configure add messages name=Standard timestampformat="%Y-%m-%d %H:%M:%S"

Syslog

Key: syslog · Type: message destination

Send messages to the system log. A destination is followed by = and a comma separated list of message types: all, debug, abort, fatal, error, warning, info, saved, notsaved, skipped, mount, terminate, restored, security, alert, volmgmt, audit. !type removes a type, so “all, !skipped, !saved” means everything but the file lists.

Messages {
  Name = Standard
  Syslog = all, !skipped, !saved, !audit
}

In the console:

configure add messages name=Standard syslog="all, !skipped, !saved, !audit"

Mail

Key: mail · Type: message destination

Mail the messages to the addresses before the second = (comma separated) when the job ends, as one mail per job. A destination is followed by = and a comma separated list of message types: all, debug, abort, fatal, error, warning, info, saved, notsaved, skipped, mount, terminate, restored, security, alert, volmgmt, audit. !type removes a type, so “all, !skipped, !saved” means everything but the file lists.

Messages {
  Name = Standard
  Mail = admin@example.com = all, !skipped, !saved, !audit
}

In the console:

configure add messages name=Standard mail="admin@example.com = all, !skipped, !saved, !audit"

Mail On Error

Key: mailonerror · Type: message destination

Like Mail, but the mail is only sent when the job did not terminate normally.

Messages {
  Name = Standard
  Mail On Error = admin@example.com = all, !skipped, !saved, !audit
}

In the console:

configure add messages name=Standard mailonerror="admin@example.com = all, !skipped, !saved, !audit"

Mail On Success

Key: mailonsuccess · Type: message destination

Like Mail, but only for jobs that terminated normally.

Messages {
  Name = Standard
  Mail On Success = reports@example.com = all, !skipped, !saved, !audit
}

In the console:

configure add messages name=Standard mailonsuccess="reports@example.com = all, !skipped, !saved, !audit"

File

Key: file · Type: message destination

Write the messages to a file, which is overwritten when the Director starts. A destination is followed by = and a comma separated list of message types: all, debug, abort, fatal, error, warning, info, saved, notsaved, skipped, mount, terminate, restored, security, alert, volmgmt, audit. !type removes a type, so “all, !skipped, !saved” means everything but the file lists.

Messages {
  Name = Standard
  File = "/var/log/bareos/last.log" = all, !skipped
}

In the console:

configure add messages name=Standard file="\"/var/log/bareos/last.log\" = all, !skipped"

Append

Key: append · Type: message destination

Append the messages to a file. The usual log of Bareos is configured like this; rotate it with logrotate. A destination is followed by = and a comma separated list of message types: all, debug, abort, fatal, error, warning, info, saved, notsaved, skipped, mount, terminate, restored, security, alert, volmgmt, audit. !type removes a type, so “all, !skipped, !saved” means everything but the file lists.

Messages {
  Name = Standard
  Append = "/var/log/bareos/bareos.log" = all, !skipped, !saved, !audit
}

In the console:

configure add messages name=Standard append="\"/var/log/bareos/bareos.log\" = all, !skipped, !saved, !audit"

Stdout

Key: stdout · Type: message destination

Print the messages on standard output of the daemon (mostly for debugging in the foreground).

Messages {
  Name = Standard
  Stdout = all
}

In the console:

configure add messages name=Standard stdout=all

Stderr

Key: stderr · Type: message destination

Print the messages on standard error of the daemon.

Messages {
  Name = Standard
  Stderr = all
}

In the console:

configure add messages name=Standard stderr=all

Director

Key: director · Type: message destination

Send the messages of a File or Storage Daemon to the Director named before the second =; only used in the daemons’ own Messages resources.

Messages {
  Name = Standard
  Director = bareos-dir = all, !skipped, !restored
}

In the console:

configure add messages name=Standard director="bareos-dir = all, !skipped, !restored"

Console

Key: console · Type: message destination

Keep the messages for the consoles: they appear with the messages command (and automatically with autodisplay on).

Messages {
  Name = Standard
  Console = all, !skipped, !saved
}

In the console:

configure add messages name=Standard console="all, !skipped, !saved"

Operator

Key: operator · Type: message destination

Send the messages to the operator addresses through Operator Command, at once rather than at the end of the job. Typical for mount requests.

Messages {
  Name = Standard
  Operator = admin@example.com = mount
}

In the console:

configure add messages name=Standard operator="admin@example.com = mount"

Catalog

Key: catalog · Type: message destination

Store the messages in the catalog (table Log); the job log shown by list joblog and by the GUI comes from there.

Messages {
  Name = Standard
  Catalog = all, !skipped, !saved, !audit
}

In the console:

configure add messages name=Standard catalog="all, !skipped, !saved, !audit"

Message types block

The types a destination lists after =, separated by commas; !type excludes one.

DirectiveTypeDefaultSummary
allmessage typeEvery message type; combine with !type to exclude some.
debugmessage typeDebug messages.
abortmessage typeA daemon aborts.
fatalmessage typeFatal errors: the job is terminated.
errormessage typeErrors; the job goes on.
warningmessage typeWarnings.
infomessage typeInformational messages.
savedmessage typeOne line per saved file (only with high verbosity).
notsavedmessage typeFiles that could not be saved.
skippedmessage typeFiles skipped by the FileSet options (for example unchanged files).
mountmessage typeMount requests and volume mount messages.
terminatemessage typeThe job end report.
restoredmessage typeOne line per restored file.
securitymessage typeSecurity relevant messages, such as failed authentication.
alertmessage typeAlerts, for example from tape drives.
volmgmtmessage typeVolume management messages.
auditmessage typeAudit log of console commands (Auditing in the Director).

all

Key: all · Type: message type

Every message type; combine with !type to exclude some.

debug

Key: debug · Type: message type

Debug messages.

abort

Key: abort · Type: message type

A daemon aborts.

fatal

Key: fatal · Type: message type

Fatal errors: the job is terminated.

error

Key: error · Type: message type

Errors; the job goes on.

warning

Key: warning · Type: message type

Warnings.

info

Key: info · Type: message type

Informational messages.

saved

Key: saved · Type: message type

One line per saved file (only with high verbosity).

notsaved

Key: notsaved · Type: message type

Files that could not be saved.

skipped

Key: skipped · Type: message type

Files skipped by the FileSet options (for example unchanged files).

mount

Key: mount · Type: message type

Mount requests and volume mount messages.

terminate

Key: terminate · Type: message type

The job end report.

restored

Key: restored · Type: message type

One line per restored file.

security

Key: security · Type: message type

Security relevant messages, such as failed authentication.

alert

Key: alert · Type: message type

Alerts, for example from tape drives.

volmgmt

Key: volmgmt · Type: message type

Volume management messages.

audit

Key: audit · Type: message type

Audit log of console commands (Auditing in the Director).

See also: configuration reference, configure, show