diff options
author | Joerg Steffens <joerg.steffens@bareos.com> | 2021-12-22 20:33:21 +0300 |
---|---|---|
committer | Joerg Steffens <joerg.steffens@bareos.com> | 2022-04-06 15:33:24 +0300 |
commit | 177dcced7abe10a8f73123546cc2e8123fd1e440 (patch) | |
tree | 237deb427d6589858a908c203e271c865970c5ef /contrib | |
parent | 72ca475b8f79795e26b07089993c25baf75c069a (diff) |
contrib bareos_option_example: adapted for Bareos >= 20
Diffstat (limited to 'contrib')
3 files changed, 6 insertions, 3 deletions
diff --git a/contrib/fd-plugins/bareos_option_example/BareosFdPluginFileInteract.py b/contrib/fd-plugins/bareos_option_example/BareosFdPluginFileInteract.py index cea08e93f..a74d23341 100644 --- a/contrib/fd-plugins/bareos_option_example/BareosFdPluginFileInteract.py +++ b/contrib/fd-plugins/bareos_option_example/BareosFdPluginFileInteract.py @@ -21,7 +21,7 @@ class BareosFdPluginFileInteract(BareosFdPluginBaseclass): def handle_backup_file(self, savepkt): bareosfd.DebugMessage(100, "handle_backup_file called with " + str(savepkt) + "\n"); bareosfd.DebugMessage(100, "fname: " + savepkt.fname + " Type: " + str(savepkt.type) + "\n"); - if (savepkt.type == bFileType['FT_REG']): + if (savepkt.type == bareosfd.FT_REG): bareosfd.DebugMessage(100, "regular file, do something now...\n"); # Add your stuff here. diff --git a/contrib/fd-plugins/bareos_option_example/README.md b/contrib/fd-plugins/bareos_option_example/README.md index 6c7a59acd..b155eb732 100644 --- a/contrib/fd-plugins/bareos_option_example/README.md +++ b/contrib/fd-plugins/bareos_option_example/README.md @@ -3,7 +3,7 @@ Sample for an option plugin. The method handle_backup_file gets called for each as template for your option plugin to implement some extra action on files. ## Prerequisites -You need the package bareos-filedaemon-python-plugin installed on your client. +You need the package `bareos-filedaemon-python-plugin` installed on your client. ## Configuration @@ -24,7 +24,9 @@ FileSet { Options { compression=GZIP signature = MD5 - Plugin = "python:module_path=/usr/lib64/bareos/plugins:module_name=bareos-fd-file-interact" + Plugin = "python:" + "module_path=/usr/lib64/bareos/plugins:" + "module_name=bareos_option_example" } File = /etc #... diff --git a/contrib/fd-plugins/bareos_option_example/__init__.py b/contrib/fd-plugins/bareos_option_example/__init__.py index a05af2dd2..10ad8acab 100644 --- a/contrib/fd-plugins/bareos_option_example/__init__.py +++ b/contrib/fd-plugins/bareos_option_example/__init__.py @@ -9,6 +9,7 @@ import bareosfd # This module contains the wrapper functions called by the Bareos-FD, the functions call the corresponding # methods from your plugin class import BareosFdWrapper +from BareosFdWrapper import * # This module contains the used plugin class from BareosFdPluginFileInteract import BareosFdPluginFileInteract |