Hello,
you could define the Script in each Job, using the "Run Before Job" and
"Run After Job" shortcuts to save some lines if you want, for example
Job {
Name = 00_TestBackupJob_vm_testvm
JobDefs = "00_TestBackupJobDefs"
Run Before Job = "/root/bin/testjob before testvm \"%j\""
Run After Job = "/root/bin/testjob after testvm \"%j\""
}
Job {
Name = 00_TestBackupJob_vm_www01
JobDefs = "00_TestBackupJobDefs"
Run Before Job = "/root/bin/testjob before www01 \"%j\""
Run After Job = "/root/bin/testjob after www01 \"%j\""
}
...
JobDefs {
Name = "00_TestBackupJobDefs"
Type = Backup
Client = "backup1-fd"
...
}
Other than that way, developing a Bareos Python Plugin to backup oVirt VMs
would be the way to go, using the oVirt Backup/Restore API:
http://www.ovirt.org/develop/release-management/features/storage/backup-restore-api-integration/
We have that on the roadmap already, it's also on the list features are open
to co-funding:
https://www.bareos.com/en/co-funding.html
It only says "RHEV" there, but as oVirt is the upstream project for RHEV, the
API is the same.
However, contributions are always welcome, too.
Regards,
Stephan
On 05/16/2017 11:34 AM, Dori Seliskar wrote:
> Hello,
>
> for bareos backup setup I'm working on I need to pass client name to my
> script.
> It is clientless/networkless backup in oVirt virtualization where I have only
> one
> client fd (vm that has bareos installed), snapshot disks from other vm get
> attached
> to it, backuped, detached, etc.
>
> So to differ jobs better at restore time I add clients that point to same fd
> like this:
>
> Client {
> Name = testvm # Virtual Machine Name
> Description = "VM testvm"
> Address = localhost
> Password = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> }
>
> the problem is that dir honnors the client name in config but it is lost
> until fd runs the script line.
>
> If I run following job:
>
> Job {
> Name = 00_TestBackupJob
> JobDefs = "00_TestBackupJobDefs"
> Client = "testvm"
> }
>
> JobDefs {
> Name = "00_TestBackupJobDefs"
> Type = Backup
> ...
> Run Script {
> RunsWhen = Before
> FailJobOnError = Yes
> Command = "/root/bin/testjob before \"%c\" \"%j\""
> }
>
> Run Script {
> RunsWhen = After
> FailJobOnError = Yes
> Command = "/root/bin/testjob after \"%c\" \"%j\""
> }
>
> }
>
> I get in log:
>
> bareos-dir JobId 267: Bareos bareos-dir 16.2.4 (01Jul16):
> Build OS: x86_64-redhat-linux-gnu redhat CentOS Linux release 7.0.1406
> (Core)
> JobId: 267
> Job: 00_TestBackupJob.2017-05-16_09.39.27_18
> Backup Level: Full
> Client: "testvm" 16.2.4 (01Jul16) x86_64-redhat-linux-gnu,redhat,CentOS
> Linux release 7.0.1406 (Core) ,CentOS_7,x86_64
> FileSet: "00_TestBackupJobFileSet" 2017-05-16 09:39:27
> Pool: "Full" (From Job FullPool override)
>
> which states "correct" client name "testvm" but later
> %c is changed to "backup1-fd" in line:
>
> backup1-fd JobId 267: shell command: run ClientAfterJob
> "/root/bin/testjob after "backup1-fd"
> "00_TestBackupJob.2017-05-16_09.39.27_18""
>
> Probably because fd simply places it's own name instead of %c.
>
> Is it possible to somehow pass the configured client name to script ? Or
> maybe another approach to
> configuring clientless backup in bareos ?
>
> best regards,
> dori
>
--
Stephan Dühr [email protected]
Bareos GmbH & Co. KG Phone: +49 221-630693-90
http://www.bareos.com
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. Steffens, Philipp Storz
--
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.