Issue with @| syntax and plugin strings

27 views
Skip to first unread message

Andri

unread,
Sep 29, 2026, 12:13:00 PM (6 days ago) Sep 29
to bareos-users
Hello everyone
I was trying to set up a small script that would automatically define filesets for multiple databases. It essentialy goes:
#!/bin/bash
for db in dba dbb dbc; do
cat << EOF
FileSet {
  Name=DB-$db
  Enable VSS = yes
  Include{
    Options{
      Signature = XXH128
    }
  Plugin = "mssqlvdi:database=$db:username=bareos:password=password"
}}
EOF
done
When I copy the output of that script (I stored it as DB.sh) into a .conf file, and do a bconsole reload, everything works and gets parsed as expected. When, however, I try to use @|/etc/bareos/bareos-dir.d/fileset/DB.sh in a .conf file, reloading fails with the following error:
29-Sep 17:54 bareos-dir: ERROR in dird/inc_conf.cc:1054 Config error: Keyword FileSet not permitted in this resource
            : line 9, col 8 of file |/etc/bareos/bareos-dir.d/fileset/DB.sh
FileSet {

29-Sep 17:54 bareos-dir: ERROR in lib/parse_conf_state_machine.cc:118 Config error: not in resource definition: Name
            : line 10, col 6 of file |/etc/bareos/bareos-dir.d/fileset/DB.sh
  Name=DB-dbb

29-Sep 17:54 bareos-dir: ERROR in lib/parse_conf.cc:230 Config error: ParseAllTokens failed.
            : line 10, col 6 of file |/etc/bareos/bareos-dir.d/fileset/DB.sh
  Name=DB-dbb

29-Sep 17:54 bareos-dir JobId 0: Error: Please correct the configuration in /etc/bareos/bareos-dir.d/*/*.conf
29-Sep 17:54 bareos-dir JobId 0: Error: Resetting to previous configuration.

Note that it complains about line 9, so the second fileset definition. It kind of looks like the first definition doesn't get closed correctly? The issue seems to have something to do with the quotation marks around the plugin string. When I remove those, reloading does not fail, but also does not produce the desired plugin string (show fileset=DB-dba outputs Plugin = "mssqlvdi:database", leaving out most of the info in the plugin string). I have also already tried escaping the quotation marks, but couldn't get it to work.

Does anyone know what I'm doing wrong? I am pretty new to both bareos and bash scripting, so the issue may very well be something trivial.

Thank you for your help!
Andri

Sebastian Sura

unread,
Sep 30, 2026, 7:45:28 AM (6 days ago) Sep 30
to bareos...@googlegroups.com

Hello Andri,

looks like you found a bug in our configuration parser.  Feel free to open an issue at https://github.com/bareos/internal/issues.
As a quick workaround, just leave an extra blank line after `Plugin =`, i.e.

#!/bin/bash
for db in dba dbb dbc; do
cat << EOF
FileSet {
  Name=DB-$db
  Enable VSS = yes
  Include{
    Options{
      Signature = XXH128
    }
  Plugin = "mssqlvdi:database=$db:username=bareos:password=password"

}}
EOF
done

works for me! It looks like our parser eats one line too many when it parses script output, but I have not looked to deeply into why that is and where it happens.

Kind Regards
Sebastian Sura

Am 29.09.26 um 18:13 schrieb Andri:
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bareos-users/1a318a29-10e6-47ce-93e3-8ace5db5de14n%40googlegroups.com.
-- 
 Sebastian Sura                  sebasti...@bareos.com
 Bareos GmbH & Co. KG            Phone: +49 221 630693-0
 https://www.bareos.com
 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
 Komplementär: Bareos Verwaltungs-GmbH
 Geschäftsführer: Stephan Dühr, Jörg Steffens, Philipp Storz
Reply all
Reply to author
Forward
0 new messages