On Friday, 22 April 2016 11:00:13 UTC+1, [email protected]  wrote:
> Hi Philipp
> 
> > You can give the restore command all things in one line: e.g.:
> > 
> > restore client=<client> fileset=<fileset> restoreclient=<client> \
> >   where=/tmp/bareos-restores select all done
> > 
> > You only need to give this command to bconsole and it will restore.
> 
> that helped a lot, thanks!
> I know created a script that looks like this:
> 
> bconsole <<END_OF_DATA
> restore client=someclient-fd restoreclient=someotherclient-fd select 
> current all where=/path/to/restore
> done
> yes
> quit
> END_OF_DATA
> 
> Unfortunately that doesn't fit my needs exactly, because on 
> someclient-fd we run two different backup jobs - one of them ist 
> executed daily, and the other one is executed hourly. I like to restore 
> the latest backup of the daily backup job. The above example restores 
> the current job of the client - which is mostly one of the hourly jobs. 
> :-(
> Is it possible to put a job name into the script instead of (or 
> additionally to) a client name?
> 
> Thanks and greets
> Stephan
> 
> 
> Am 22.04.2016 10:31 schrieb Philipp Storz:
> > You can give the restore command all things in one line: e.g.:
> > 
> > restore client=<client> fileset=<fileset> restoreclient=<client> \
> >   where=/tmp/bareos-restores select all done
> > 
> > You only need to give this command to bconsole and it will restore.
> > 
> > On 22.04.2016 10:29, [email protected] wrote:
> >> Am 22.04.2016 10:21 schrieb Philipp Storz:
> >>> Please refer to the bareos documentation. What is this bacula you are
> >>> talking about?
> >> 
> >> oh - I'm so embarrassed... ;-( Of course I meant this one:
> >> http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-17800016
> >> 
> >> Sorry and greets
> >> Stephan
> >> 
> > 
> > 
> > --
> > Mit freundlichen Grüßen
> > 
> >  Philipp Storz                             [email protected]
> >  Bareos GmbH & Co. KG                      Phone: +49 221 63 06 93-92
> >  http://www.bareos.com                     Fax:   +49 221 63 06 93-10
> > 
> >  Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
> >  Geschäftsführer: Stephan Dühr, M. Außendorf,
> >  J. Steffens, P. Storz, M. v. Wieringen

Yes you can do it but that requires a bit more bash scripting, you'll need at 
least to pipe commands to bconsole to get the arguments to build the restore 
command (i.e. the jobid) you want and then do something like:

  bconsole <<-EOF
        @output /dev/null
        messages
        @output
        $BAREOS_RESTORE_COMMAND

        messages
        @output
        EOF

With e.g. BAREOS_RESTORE_COMMAND="restore client=$CLIENT 
restoreclient=$RESTORE_CLIENT fileset=$FILESET pool=$POOL storage=$STORAGE 
jobid=${job_id//,/} select all done yes"

The parameter expansion on the jobid is useful for jobids>=1000.

Hope that helps.

Franck

-- 
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