Constants#

Definition#

Constants are user-defined strings that can be used in any text field of the web interface. So, they are kind of like a dictionary that you can open to get the values to use. Constants function is available since Bacularis version 5.2.0.

This function can be useful for frequently used strings. For example if a user uses the same long phrase in different Bacula resource names, he/she can save it in a constant and use it quickly without having to type the phrase manually each time it is used.

Constant consists of the following properties:

  • name - constant name (allowed characters: A-Za-z0-9_)

  • description - (optional) explanation of the purpose of the constant

  • value - the constant value pasted into text field on the constant name use

The following example types of values can be stored in constants:

  • names (ex: main-nas-server, LocalSystem123, Mainframe GcR B2, PostgreSQL …)

  • paths (ex: /home/john/important-files, C:/Program Files/, /10.0.10.2/system/files …)

  • directories (ex: Trash, UserData, Network Trash Folder …)

  • dates (ex: 2025/05, 2025, 2025-05-06 15:59:10 …)

  • places (ex: Server Room 4C, New York, building-422 …)

  • …etc.

How to use constants?#

First, you need to define constants you want to use. You can do this on the Patterns page on the Constants tab:

[Main menu] => [Page: Patterns] => [Tab: Constants]

Once you have defined the constants, you can use them in any text field in Bacularis by typing % (percent sign) where you want to paste the constant value.

After entering % sign, the constant picker should appear. In the picker you can select constants you want to use. You can also filter constants by entering part of the constant name.

../_images/bacularis_constants_example_usage.png

Video guide#

Below you can watch a video tutorial that presents how to use constants: