Skip to content

Messages resource

Configuration directives for the Messages resource. Every directive is listed; value types and defaults are noted where the source provides them.

<destination> = <message-type1>, <message-type2>, ...

Where destination may be one of the following:

stdout Send the message to standard output.

destination = address = message-type1, message-type2, message-type3, ...

Where destination is one of a predefined set of keywords that define where the message is to be sent (stdout, file, …), message-type is one of a predefined set of keywords that define the type of message generated by NGBackup (ERROR, WARNING, FATAL, …), and address varies according to the destination keyword, but is typically an email address or a filename.

MailCommand = <command>

In the absence of this resource, NGBackup will send all mail using the following command: mail -s “NGBackup Message” <recipients>

In many cases, depending on your machine, this command may not work. However, by using the MailCommand, you can specify exactly how to send the mail. During the processing of the command part, normally specified as a quoted string, the following substitutions will be used:

`

%% = % %b = Job Bytes %c = Client’s name %C = If the job is a Cloned job (Only on director side) %d = Daemon’s name (Such as host-dir or host-fd) %D = Director’s name (Also valid on file daemon) %e = Job Exit Status %E = Non-fatal Job Errors %f = Job FileSet (Only on director side) %F = Job Files %h = Client address %i = JobId %I = Migration/Copy JobId (Only in Copy/Migrate Jobs) %j = Unique Job id %l = Job Level %n = Job name %o = Job Priority %p = Pool name (Only on director side) %P = Current PID process %r = Recipients %R = Read Bytes %s = Since time %S = Previous Job name (Only on file daemon side) %t = Job type (Backup, …) %v = Volume name (Only on director side) %w = Storage name (Only on director side) %x = Spooling enabled? (“yes” or “no”)

`

Please note: any MailCommand directive must be specified in the Messages resource before the desired Mail, MailOnSuccess, or MailOnError directive. In fact, each of those directives may be preceded by a different MailCommand.

The following is an example. Note, the whole command should appear on a single line in the configuration file rather than split as is done here for presentation:

mailcommand = “/opt/backup/bin/bsmtp -h mail.example.com -f ”(NGBackup) %r ” -s “NGBackup: %t %e of %c %l” %r”

The bsmtp program is provided as part of NGBackup. For additional details, please see the bsmtp - Customizing Your Email Messages section of the NGBackup Utility Programs manual. Please test any mailcommand that you use to ensure that your bsmtp gateway accepts the addressing form that you use. Certain programs such as Exim can be very selective as to what forms are permitted particularly in the from part. Be careful, most of the samples use %r in the sender part of the mailcommand. This is a convenient way to setup the sender and the recipient at once. When you configure multiple recipients (separated by a comma) you must replace the %r in the sender part with only one valid email address.

Start of the Messages records.

Name = <name>

The name of the Messages resource. The name you specify here will be used to tie this Messages resource to a Job and/or to the daemon.

OperatorCommand = <command>

This resource specification is similar to the MailCommand except that it is used for Operator messages. The substitutions performed for the MailCommand are also done for this command. Normally, you will set this command to the same value as specified for the MailCommand. The OperatorCommand directive must appear in the Messages resource before the Operator directive.