Hi!
I'd like to use the new Run-directive in the Job Resource to define a
job that should be run after the main backup-job. (This job should
backup the bacula database directory and is called BackupCatalog.)
However, since my schedule uses daily incremental backups that go to a
"PoolDaily" during the week, weekly full backups that go to "PoolWeekly"
and monthly full backups that go to "PoolMonthly", I'd like to specify
the BackupCatalog-Job to use the same pool as the main backup job and
hence use the same tape.
I'd like to use a variable like "%p" that is substituted for the pool,
that the current job is using, to allow starting the BackupCatalog-job
like that:
Job {
Name = "Samba-Homes"
Schedule = "WeeklyCycle"
[...]
Run = "BackupCatalog level=%l since=\"%s\" storage=DLT1 pool=%p"
}
I've found out that "%v" is substituted by the volume-name in
edit_job_codes() (in lib/util.c) but it looks like there is no variable
for the pool.
So I tried to add this feature using the attached patch.
However, it doesn't compile because the pool attribute is only compiled
into the class JCR, if DIRECTOR_DAEMON is defined. (See jcr.h)
Unfortunately, when lib/util.c is compiled, DIRECTOR_DAEMON isn't
defined. So jcr->pool isn't available at compile time in
edit_job_codes(). However, since jcr is passed from is passed from
do_backup_init() in dird/backup.c, it should be available at run-time.
I'd appreciate any hint at how to solve the problem...
Cheers,
--leo
--
-----------------------------------------------------------------------
[EMAIL PROTECTED] Fax: +43-1-31336-906050
Zentrum fuer Informatikdienste - Wirtschaftsuniversitaet Wien - Austria
--- src/lib/util.c.orig 2005-11-17 15:02:31.365260719 +0100
+++ src/lib/util.c 2005-11-17 15:03:45.888108025 +0100
@@ -592,6 +592,13 @@
str = _("*none*");
}
break;
+ case 'p': /* Job name */
+ if (jcr) {
+ str = jcr->pool->hdr.name;
+ } else {
+ str = _("*none*");
+ }
+ break;
case 'r':
str = to;
break;