Hello Thorsten, For bconsole you can only use Bacula variables such as ${Pool}, I'm just not sure how you are going to change their value for your specific use case. Not sure also if there is a Volume variable. You might be better with a Shell redirection to | bconsole or a SQL delete command. Why are you deleting volumes sistematicaly anyway?
Regards, -- MSc Heitor Faria CEO Bacula LatAm mobile1: + 1 909 655-8971 mobile2: + 55 61 98268-4220 América Latina [ http://bacula.lat/] -------- Original Message -------- From: Davide Franco <bacula-...@dflc.ch> Sent: Thursday, February 27, 2020 01:49 AM To: Thorsten Johannsen <thorsten-johann...@gmx.net> Subject: Re: [Bacula-users] RunScripts: Variable Substitution not working CC: Bacula-users <bacula-users@lists.sourceforge.net> >Hello Thorsten, > >I finally found a thread in the bacula users mailing list which might >interest you. >https://sourceforge.net/p/bacula/mailman/message/36259669/ > >I didn't tested it but I thought it might be helpful to you. >Hope it helps ... > >Best regards > >Davide > >On Sun, Jan 12, 2020 at 3:16 PM Thorsten Johannsen < >thorsten-johann...@gmx.net> wrote: > >> Hi Davide, >> >> thank you very much for your response. I already tried to crawl the >> mailing list archive prior to sending this email but I also came up empty >> :-( >> >> From the manual link you provided I understand two things: >> >> 1) "Console options are special commands that are *sent to the director* >> instead of the OS" >> >> -> this means that the following line >> >> Console ="delete yes volume=%v" >> >> should have worked, right? >> >> 2) The directive >> >> RunsOnClient = no >> >> >> indicates, according to the manual, that the command is *not run on >> Client* - so where does it run? I assume on the director? >> >> Furthermore, the manual states: >> >> Some character substitutions are not available in all situations. >> >> In my humble opinion, it would be beneficial to have a matrix which >> substitution will or will not work in which situation. I would be happy to >> create such a matrix if there was some "authoritive answer" e.g. some way >> to be sure to have the correct information :-) (and, to be honest, if it >> would not involve extracting it from source code... I'm not really got at >> coding :-() >> >> Well, I will keep digging :-) >> >> Thanks again, >> Cheers, >> Thorsten >> >> >> On 12.01.20 14:49, Davide Franco wrote: >> >> Hi Thorsten, >> >> As mentioned in documentation >> >> >> https://www.bacula.org/9.4.x-manuals/en/main/Configuring_Director.html#SECTION002030000000000000000 >> >> %v is only available from the director. >> >> Make sure the script is run from the director. >> >> Try to look at bacula users mailing list archive, I’m sure someone already >> asked for the same question but I can’t find it yet. >> >> Hope it helps >> >> Davide >> >> On Sat, 11 Jan 2020 at 11:38, Thorsten Johannsen < >> thorsten-johann...@gmx.net> wrote: >> >>> Hi, >>> >>> I'm using Bacula 9.0.7 and try to delete volumes that were created but >>> where the backup job did not complete. >>> >>> E.g. >>> >>> 2020-01-11 11:04:45heZZZ-dir JobId 10826: Start Backup JobId 10826, >>> Job=Job_XXX02.2020-01-11_11.04.43_09 >>> 2020-01-11 11:04:46heZZZ-dir JobId 10826: Created new >>> Volume="IncBackup__XXX02-fd__10826__2020-01-11T11.04.45", >>> Pool="Pool_IncBackup", MediaType="MT-heZZZ-sd-AC-IncBackup" in catalog. >>> 2020-01-11 11:04:46heZZZ-dir JobId 10826: Using Device >>> "AC-IncBackup-Dev01" to write. >>> 2020-01-11 11:05:02heZZZ-dir JobId 10826: Warning: bsock.c:153 Could not >>> connect to Client: heXXX02-fd on heXXX02:9102. ERR=No route to host >>> >>> >>> >>> so: >>> 1) Volume is created >>> 2) Client connect failed >>> 3) Volume is created but empty. >>> >>> I thought I could catch this with a runscript in the JobDefs: >>> >>> ------------------------------------------------------------ >>> JobDefs { >>> Name = "JD_heDefault" >>> Type = "Backup" >>> >>> [...] >>> >>> RunScript { >>> #Console ="delete yes volume=%v" >>> Command = "echo delete yes volume=%v | bconsole" >>> RunsWhen = After >>> RunsOnFailure = yes >>> RunsOnClient = no >>> RunsOnSuccess = no >>> } >>> >>> } >>> >>> >>> ------------------------------------------------------------ >>> >>> I tried with command= as stated above and also with Console="delete yes >>> volume=%v". Both does not work. It seems as if %v does not get substituted. >>> eMail notifcation shows: >>> >>> 2020-01-11 11:07:58heZZZ-dir JobId 10826: console command: run AfterJob >>> "delete yes volume=" >>> >>> >>> Can someone give me a hint about what I'm doing wrong here? >>> >>> Thanks in advance, >>> >>> Thorsten >>> >>> >>> >>> _______________________________________________ >>> Bacula-users mailing list >>> Bacula-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/bacula-users >>> >> >> _______________________________________________ >> Bacula-users mailing list >> Bacula-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/bacula-users >> > > >_______________________________________________ >Bacula-users mailing list >Bacula-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/bacula-users
_______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users