Am 22.04.2016 um 23:18 schrieb Franck Ratier:
> 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.

if multiple bconsole commands are required, I prefer using
https://www.bareos.org/en/python-bareos.html, probably in JSON mode.

Required commands could be:

# get last successful job run of a specific job
list jobs job=BackupClient1 jobstatus=T last

result: jobid=X

# if this wasn't a full, get all jobids for a full restore
.bvfs_get_jobids jobid=X

Then trigger the restore with all jobids.

Jörg

-- 
 Jörg Steffens                   [email protected]
 Bareos GmbH & Co. KG            Phone: +49 221 630693-91
 http://www.bareos.com           Fax:   +49 221 630693-10

 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
 Komplementär: Bareos Verwaltungs-GmbH
 Geschäftsführer:
 S. Dühr, M. Außendorf, Jörg Steffens, P. Storz, M. v. Wieringen

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