On lundi, 2 janvier 2017 09.20:17 h CET Robert N wrote:
> Hi Bruno,
> 
> Happy New Year!
> 
> what version of Bareos do you use?
> 
> I try to use the same on 15.2.3 on Centos6:
> 
> Storage {
> 
>   @|"sh -c 'idx=$(cat /tmp/bkp_idx 2>/dev/null || echo 0) ; echo -n Device =
> DiskDeviceIncr ; echo $((($idx % 5) + 1)) | tee /tmp/bkp_idx'"
> 
> }
> 
> but when I try to validate the config, it fails with following error,
> although the output generated by the script is correct. I tried replacing
> the @| line  with :"Device = DiskDeviceIncr2" the exact output of script,
> and it works.
> 
> 
> [root@muc1pro-backup-1 bareos]# bareos-dir -t -v
>   bareos-dir: ERROR TERMINATION at res.c:575
> Config error: Could not find config Resource "Device" referenced on line 1 :
> Device = DiskDeviceIncr2
>             : line 1, col 24 of file |sh -c 'idx=$(cat /tmp/bkp_idx
>             : 2>/dev/null || echo 0) ; echo -n Device = DiskDeviceIncr ;
>             : echo $((($idx % 5) + 1)) | tee /tmp/bkp_idx'
> Device = DiskDeviceIncr2
> 
> Thanks,
> Robert

Hi Robert, 

I wouldn't expect that the lexical parser is able to run the script.
It expect to have a mandatory Device parameter an equal sign (=) then a value 
quoted or not and a end of line.

So Probably a line with
Device = "__some_kind_of_magic_good_luck_script" 
and the correct @| \@| would work and make lexical parser happier.

Also not sure how the general daemon would react on dynamic device ....
Which is still for my brain not completely understable.


-- 

Bruno Friedmann 
 Ioda-Net Sàrl www.ioda-net.ch
 Bareos Partner, openSUSE Member, fsfe fellowship
 GPG KEY : D5C9B751C4653227
 irc: tigerfoot

openSUSE Tumbleweed
Linux 4.9.0-2-default x86_64 GNU/Linux, nvidia: 375.26
Qt: 5.7.1, KDE Frameworks: 5.29.0, Plasma: 5.8.4, kmail2 5.4.0

-- 
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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to