[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] Clone jobs and storage


some months ago, I submitted a patch to be able to access the pool of the 
parental job in clone jobs. Today, I needed access to the storage as well; 
unfortunately, storages are not always easy to handle in job definitions, as 
there may be
* A storage def. in the job
* A different one in the job's pool
* A third one in the schedule
* Possibly another one when running the job manually...

The Pool storage takes precedence for clone jobs currently.

The attached (obvious) patch adds a code %w (for "write storage") for clones 
to access the storage used for the parent job; you can thus use
Job {
  Name = ...
  Run = "job=... fileset=... storage=%w"

Feel free to use :)

I don't really like the "%w" though... :-/

Thx, Best Regards

Collax GmbH . Burkheimer Straße 3 . 79111 Freiburg . Germany
p: +49 (0) 761-45684-24
f: +49 (0) 761-45684-10        www.collax.com

Geschäftsführer: William K. Hite / Boris Nalbach
AG München HRB 158898 . Ust.-IdNr: DE 814464942
\ Schatz, dein Perl sieht nicht grad umwerfend aus
--- bacula-2.5-20080709svn/src/dird/job.c.ori	2008-07-09 11:25:25.000000000 +0200
+++ bacula-2.5-20080709svn/src/dird/job.c	2008-07-09 11:28:13.000000000 +0200
@@ -1310,8 +1310,9 @@
 char *job_code_callback_clones(JCR *jcr, const char* param) 
-   if (param[0] == 'p') {
-      return jcr->pool->name();
+   switch (param[0]) {
+      case 'p': return jcr->pool->name(); break;
+      case 'w': return jcr->wstore->name(); break;
    return NULL;
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
Bacula-devel mailing list

This mailing list archive is a service of Copilotco.