I have this working now. The script is below, as per Bill's script with an
extention. It is called from a Runscript as "Command =
/full-path/run-copy-job.sh copy-job-name". There is a copy job defined for
each backup job. The $1 parameter passes the copy job name to the script.

#!/bin/bash
#usage run-copy-job.sh job-name
# Pipe the run command to bconsole
# --------------------------------
echo "run yes job=$1" | bconsole

This all works fine. The disadvantage is that the copy job hard codes the
level to be copied so the same copy job (in my case full) runs irrespective
of the job being incr/diff/full. For "selection type=PoolUncopiedJobs" this
is only a minor issue since already copied jobs are skipped.

Chris

On Tue, 9 Apr 2024, 15:12 Bill Arlofski, <w...@protonmail.com> wrote:

> On 4/9/24 6:53 AM, Chris Wilkinson wrote:
> > Regarding the suggestion to put a Runafter block in the job to run the
> copy job at the end, that doesn't seem to be allowed.
> > Run job=xx commands are not permitted in a Runscript as I just found
> out. It gives a not allowed command error.
> >
> > Perhaps there is another way to accomplish this?
> >
>
> Hello Chris,
>
> Yes, convert that run command to a simple script like:
>
> /opt/bacula/script/run_catalog-copy.sh:
> ----8<----
> #!/bin/bash
>
> # Pipe the run command to bconsole
> # --------------------------------
> echo "run yes job=catalog-copy" | bconsole
> ----8<----
>
> Now, that is the most basic it needs to be, but you can add other things
> to it. ie: error checking, command line options,
> etc. Although in your use case it does not seem necessary to complicate
> things. :)
>
>
> Then, just replace the
> ----8<----
> Console = "run job=catalog-copy yes"
> ----8<----
>
> ...line in your RunScript with:
>
> ----8<----
> `Command = /opt/bacula/script/ru
> n_catalog-copy.sh`
> ----8<----
>
> And you should be OK.
>
> Make sure your `catalog-copy` job has the same Priority (11) as your
> Catalog job, otherwise you will end up in a dead-lock
> where the Copy job waits for the Catalog job to finish, and the Copy job
> is waiting for the catalog-copy job (which will
> never start) to finish.
>
>
> Hope this helps,
> Bill
>
> --
> Bill Arlofski
> w...@protonmail.com
>
>
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to