View Issue Details

IDProjectCategoryView StatusLast Update
0001587bareos-coredirectorpublic2024-01-30 11:46
Reporteralexanderbazhenov Assigned Tobruno-at-bareos  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformLinuxOSUbuntuOS Version16.04
Product Version22.1.3 
Summary0001587: Parser bugs on running script via command on server side
DescriptionJob {
    Name = "Some job name"
    JobDefs = "DefaultJob"
    Schedule = "DailyAfterBackup"
    Type = "Admin"
    Priority = 100

    RunScript {
        Runs When = Before
        Runs On Client = no
        Fail Job On Error = yes
        # This script is not included to standard Bareos install.
        Command = "/etc/bareos/bareos-dir.d/my_script.sh --action script_action --expire 31 --name Full-"
    }
}
not working anymore. Got in the log via web guy:

bareos-dir JobId 43: BeforeJob: Error: unrecognized option(s): --action

while the script is working.

Changing to:

Command = "/bin/bash -c \"/./etc/bareos/my_script.sh --action script_action --expire 31 --name Full-\""

not working also.

Bareos director version 23.0.1~pre7.606b211eb-33 on Ubuntu 20.04.

Why the string '--action' wasn't pass to the arguments?
Steps To ReproduceRun any parametrized bash key with arguments passing after '--key'.
You can take my for example: https://github.com/alexanderbazhenoff/various-scripts/blob/master/backup/bareos_pool_operations/clean_expired_baros_volumes.sh
Tagsconfiguration, director

Activities

bruno-at-bareos

bruno-at-bareos

2024-01-08 16:05

manager   ~0005671

This is strange, for example a variation of backup catalog with the following Command work exactly has expected.

 2024-01-08 07:00:02 yoda-dir JobId 15005: shell command: run BeforeJob "/usr/bin/pg_dump --format=custom --encoding=SQL_ASCII --clean --if-exists --file=/var/lib/bareos/bare
os.pgdump bareos"

show job=catalog
..
  RunScript {
    Command = "/usr/bin/pg_dump --format=custom --encoding=SQL_ASCII --clean --if-exists --exclude-table-data=''public.pathhierarchy'' --exclude-table-data=''public.pathvisibility'' --file=/var/lib/bareos/bareos.pgdump bareos"
    RunsWhen = "before"
    RunsOnClient = No
  }
..

While in the job.conf file it look like.

  RunScript {
    Command = "/usr/bin/pg_dump --format=custom --encoding=SQL_ASCII --clean --if-exists --exclude-table-data='public.pathhierarchy' --exclude-table-data='public.pathvisibility' --file=/var/lib/bareos/bareos.pgdump bareos"
    RunsWhen = "before"
    RunsOnClient = No
  }

I didn't yet tested a pseudo bash script to check the problem.
bruno-at-bareos

bruno-at-bareos

2024-01-16 15:12

manager   ~0005687

ping
bruno-at-bareos

bruno-at-bareos

2024-01-30 11:46

manager   ~0005726

closing without feedback return.

Issue History

Date Modified Username Field Change
2023-12-30 00:57 alexanderbazhenov New Issue
2023-12-30 00:57 alexanderbazhenov Tag Attached: configuration
2023-12-30 00:57 alexanderbazhenov Tag Attached: director
2024-01-08 16:05 bruno-at-bareos Note Added: 0005671
2024-01-16 15:12 bruno-at-bareos Assigned To => bruno-at-bareos
2024-01-16 15:12 bruno-at-bareos Status new => feedback
2024-01-16 15:12 bruno-at-bareos Note Added: 0005687
2024-01-30 11:46 bruno-at-bareos Status feedback => closed
2024-01-30 11:46 bruno-at-bareos Resolution open => unable to reproduce
2024-01-30 11:46 bruno-at-bareos Note Added: 0005726