Bacula configuration plugin#
This Baculais API plugin introduces pre-
and post-
actions for
using the Bacula configuration. With these actions there is possible
to add some additional own script execution before or after reading, creating,
updating or deleting particular Bacula configuration parts.
Plugin parameters
pre_read_command
- pre-read Bacula configuration command. The Bacula config passed to this script is in JSON string form.
post_read_command
- post-read Bacula configuration command. The Bacula config
pre_create_command
- pre-create Bacula configuration command. The Bacula config passed to this script is in JSON string form.
post_create_command
- post-create Bacula configuration command. The Bacula config passed to this script is in JSON string form.
pre_update_command
- pre-update Bacula configuration command. The Bacula config passed to this script is in JSON string form.
post_update_command
- post-update Bacula configuration command. The Bacula config passed to this script is in JSON string form.
pre_delete_command
- pre-delete Bacula configuration command. The Bacula config passed to this script is in JSON string form.
post_delete_command
- post-delete Bacula configuration command. The Bacula config passed to this script is in JSON string form.
write_config_command
- on write Bacula configuration command. The Bacula config passed to this script is in the real Bacula configuration format.
All pre-
and post-
commands are executed in the following way:
"SOME BACULA CONFIGURATION" | your_pre_or_post_script.sh component_type resource_type resource_name
For example, if you add a script to the post_update_command
like here:
post_update_command = /home/john/my_script.sh
then on updating in the Bacula config the Client resource named xyz-fd
,
the command executed by the plugin looks like here:
"SOME BACULA CONFIGURATION" | /home/john/my_script.sh dir Client xyz-fd
The Bacula configuration always comes on the script STDIN
. The Bacula component and resource
names are always passed as the script parameters.
Component names:
dir
- for Bacula Director component
sd
- for Bacula Storage Daemon component
fd
- for Bacula Client/File Daemon component
bcons
- for Bacula Bconsole
Resource types:
Director component
Director
JobDefs
Job
Client
Storage
Catalog
Schedule
Fileset
Pool
Messages
Console
Statistics
Storage Daemon component
Storage
Director
Device
Autochanger
Messages
Cloud
Statistics
Client/File Daemon component
FileDaemon
Director
Messages
Schedule
Console
Statistics
Example plugin settings: