source: people/peter.buschman/backup_monitoring/parsing/parsers/bpdbjobs/test2.py@ 1259

Last change on this file since 1259 was 976, checked in by peter, on Dec 6, 2011 at 10:19:33 AM

Raw checkin of current NetBackup / TSM parsing code.

File size: 561 bytes
Line 
1
2import time
3import pytz
4
5from backup_monitoring.parsing.parsers import bpdbjobs as parser
6
7file = open('test.txt', 'r')
8
9stream = parser.stream(file)
10
11i = 0
12
13tz = pytz.timezone('CET')
14
15for record in stream:
16
17 i += 1
18
19 job = parser.parse(record, tz=tz)
20
21 jobid = job.jobid
22 jobtype = job.jobtype
23 state = job.state
24 started = job.started
25 stunit = job.stunit
26
27 if jobtype == 'backup' and jobid == 218840:
28
29 print 'jobid=%d, started=%s' % (jobid, started)
30
31 time.sleep(1)
32
33file.close()
Note: See TracBrowser for help on using the repository browser.