From: Eric Bollengier Date: Tue, 8 Aug 2023 15:41:42 +0000 (+0200) Subject: Fix #10307 Add PriorJobName and PriorJobId to the volume label format X-Git-Tag: Beta-15.0.0~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d967c9971af8bcf802983f87fc85fdcf35377bb4;p=thirdparty%2Fbacula.git Fix #10307 Add PriorJobName and PriorJobId to the volume label format For Migration and Copy job mostly Label Format = ${JobId}_${PriorJobName}_${PriorJobId} --- diff --git a/bacula/src/dird/expand.c b/bacula/src/dird/expand.c index 20861f4e1..4b7dba24c 100644 --- a/bacula/src/dird/expand.c +++ b/bacula/src/dird/expand.c @@ -126,6 +126,13 @@ static int job_item(JCR *jcr, int code, case 12: /* JobName */ str = jcr->Job; break; + case 13: + str = jcr->previous_jr.Name; /* Previous Job name */ + break; + case 14: + bsnprintf(buf, sizeof(buf), "%d", jcr->previous_jr.JobId); /* Previous JobId */ + str = buf; + break; } *val_ptr = bstrdup(str); *val_len = strlen(str); @@ -160,6 +167,8 @@ static struct s_built_in_vars built_in_vars[] = { { NT_("Catalog"), 10, job_item}, { NT_("MediaType"), 11, job_item}, { NT_("JobName"), 12, job_item}, + { NT_("PriorJobName"), 13, job_item}, + { NT_("PriorJobId"), 14, job_item}, { NULL, 0, NULL} };