Bacula-users

[Bacula-users] jobname retrieval from purged volume

2016-04-22 16:21:35
Subject: [Bacula-users] jobname retrieval from purged volume
From: 5i <5ingdefz AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 22 Apr 2016 22:20:18 +0200
Hello,

I needed to retrieve the jobname from my purged volumes (i store one job per volume) and found out about `bls -jv` which outputs the jobname among other things.
This script works for me good enough to retrieve the jobname, by applying a regex on bls output:

from subprocess import PIPE, Popen
import re

cmd = ['timeout', '1', 'bls', '/path/to/volume/Full-LT-0001', '-jv']
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
out, err = p.communicate()
print(repr(str(out)))
jobname = re.search("(\\\\nJobName.*: )(.*)(\\\\nClientName)", str(out)).group(2)
print(jobname)
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>
  • [Bacula-users] jobname retrieval from purged volume, 5i <=