From: Eric Bollengier Date: Mon, 6 Nov 2023 12:10:47 +0000 (+0100) Subject: Fix #10524 About adding JobTimestamp variable for volume format X-Git-Tag: Beta-15.0.1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a514d9f3e3bae6dca83983b37c3dd41172eeace1;p=thirdparty%2Fbacula.git Fix #10524 About adding JobTimestamp variable for volume format Label Format = "Vol.${JobTimestamp}" -> Vol.2023-10-12_20.27.20_59 --- diff --git a/bacula/src/dird/expand.c b/bacula/src/dird/expand.c index 4b7dba24c..b07f52bf4 100644 --- a/bacula/src/dird/expand.c +++ b/bacula/src/dird/expand.c @@ -133,6 +133,9 @@ static int job_item(JCR *jcr, int code, bsnprintf(buf, sizeof(buf), "%d", jcr->previous_jr.JobId); /* Previous JobId */ str = buf; break; + case 15: // Return the timestamp associated with the job name + str = jcr->Job + strlen(jcr->Job) - strlen("2023-10-12_20.27.20_59"); + break; } *val_ptr = bstrdup(str); *val_len = strlen(str); @@ -169,7 +172,7 @@ static struct s_built_in_vars built_in_vars[] = { { NT_("JobName"), 12, job_item}, { NT_("PriorJobName"), 13, job_item}, { NT_("PriorJobId"), 14, job_item}, - + { NT_("JobTimestamp"), 15, job_item}, { NULL, 0, NULL} };