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
| Directive | Type | Default | Summary | |
|---|---|---|---|---|
| Name | name | Name of the Messages resource; Jobs, the Director and daemons refer to it. | ||
| Description | string | Free text describing the resource. | ||
| Mail Command | string | Command that sends the mails of Mail, Mail On Error and Mail On Success. bsmtp is the usual choice. | ||
| Operator Command | string | Command for Operator messages (for example mount requests); same variables as Mail Command. | ||
| Timestamp Format | string | strftime format of the time stamps of these messages. | ||
| Syslog | message destination | Send messages to the system log. | ||
| message destination | Mail the messages to the addresses before the second = (comma separated) when the job ends, as one mail per job. | |||
| Mail On Error | message destination | Like Mail, but the mail is only sent when the job did not terminate normally. | ||
| Mail On Success | message destination | Like Mail, but only for jobs that terminated normally. | ||
| File | message destination | Write the messages to a file, which is overwritten when the Director starts. | ||
| Append | message destination | Append the messages to a file. | ||
| Stdout | message destination | Print the messages on standard output of the daemon (mostly for debugging in the foreground). | ||
| Stderr | message destination | Print the messages on standard error of the daemon. | ||
| Director | 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. | ||
| Console | message destination | Keep the messages for the consoles: they appear with the messages command (and automatically with autodisplay on). | ||
| Operator | message destination | Send the messages to the operator addresses through Operator Command, at once rather than at the end of the job. | ||
| Catalog | message destination | Store 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"
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.
| Directive | Type | Default | Summary | |
|---|---|---|---|---|
| all | message type | Every message type; combine with !type to exclude some. | ||
| debug | message type | Debug messages. | ||
| abort | message type | A daemon aborts. | ||
| fatal | message type | Fatal errors: the job is terminated. | ||
| error | message type | Errors; the job goes on. | ||
| warning | message type | Warnings. | ||
| info | message type | Informational messages. | ||
| saved | message type | One line per saved file (only with high verbosity). | ||
| notsaved | message type | Files that could not be saved. | ||
| skipped | message type | Files skipped by the FileSet options (for example unchanged files). | ||
| mount | message type | Mount requests and volume mount messages. | ||
| terminate | message type | The job end report. | ||
| restored | message type | One line per restored file. | ||
| security | message type | Security relevant messages, such as failed authentication. | ||
| alert | message type | Alerts, for example from tape drives. | ||
| volmgmt | message type | Volume management messages. | ||
| audit | message type | Audit 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