I'm trying to parse a file and combine all instances of each field and add the time, MB, etc.
The sample input looks like this:
Client: server1.domain.com
Backup ID: server1.domain.com_1190696991
Policy: virtualHosts_group1
Policy Type: Standard
Sched Label: AppSvr_cumul_inc
Schedule Type: Cumulative Incremental Backup
Retention Level: 2 weeks (1)
Backup Time: 09/25/2007 01:09:51
Elapsed Time: 000:01:54
Expiration Time: 10/09/2007 01:09:51
Compressed: no
Encrypted: no
Kilobytes: 32
Number of Files: 0
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: (none specified)
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: yes
TIR Available: no
Backup Copy: Standard (0)
Client: server1.domain.com
Backup ID: server1.domain.com_1190696991
Policy: virtualHosts_group1
Policy Type: Standard
Sched Label: AppSvr_cumul_inc
Schedule Type: Cumulative Incremental Backup
Retention Level: 2 weeks (1)
Backup Time: 09/25/2007 01:09:51
Elapsed Time: 000:01:54
Expiration Time: 10/09/2007 01:09:51
Compressed: no
Encrypted: no
Kilobytes: 32
Number of Files: 0
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: (none specified)
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: yes
TIR Available: no
Backup Copy: Standard (0)
Client: server2.domain.com
Backup ID: server2.domain.com_1190696991
Policy: virtualHosts_group1
Policy Type: Standard
Sched Label: AppSvr_cumul_inc
Schedule Type: Cumulative Incremental Backup
Retention Level: 2 weeks (1)
Backup Time: 09/25/2007 01:09:51
Elapsed Time: 000:01:54
Expiration Time: 10/09/2007 01:09:51
Compressed: no
Encrypted: no
Kilobytes: 32
Number of Files: 0
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: (none specified)
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: yes
TIR Available: no
Backup Copy: Standard (0)
The desired output is:
Client Policy Date Time Run Time MB # of Files
=========================================================================================
server1 virtualHosts_group1 09/25/2007 01:09:51 000:01:54 0 0
Where for each server has the time and MB added together for every iteration found in the file.
So if there are 5 backups for server1, the total backup time and MB will be added up.
I have a current awk script that parses the file, but does not add up the numbers for the total time and MB if there are multiple iterations for different backups.
Any help will be greatly appreciated.
Thanks,
John
The sample input looks like this:
Client: server1.domain.com
Backup ID: server1.domain.com_1190696991
Policy: virtualHosts_group1
Policy Type: Standard
Sched Label: AppSvr_cumul_inc
Schedule Type: Cumulative Incremental Backup
Retention Level: 2 weeks (1)
Backup Time: 09/25/2007 01:09:51
Elapsed Time: 000:01:54
Expiration Time: 10/09/2007 01:09:51
Compressed: no
Encrypted: no
Kilobytes: 32
Number of Files: 0
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: (none specified)
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: yes
TIR Available: no
Backup Copy: Standard (0)
Client: server1.domain.com
Backup ID: server1.domain.com_1190696991
Policy: virtualHosts_group1
Policy Type: Standard
Sched Label: AppSvr_cumul_inc
Schedule Type: Cumulative Incremental Backup
Retention Level: 2 weeks (1)
Backup Time: 09/25/2007 01:09:51
Elapsed Time: 000:01:54
Expiration Time: 10/09/2007 01:09:51
Compressed: no
Encrypted: no
Kilobytes: 32
Number of Files: 0
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: (none specified)
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: yes
TIR Available: no
Backup Copy: Standard (0)
Client: server2.domain.com
Backup ID: server2.domain.com_1190696991
Policy: virtualHosts_group1
Policy Type: Standard
Sched Label: AppSvr_cumul_inc
Schedule Type: Cumulative Incremental Backup
Retention Level: 2 weeks (1)
Backup Time: 09/25/2007 01:09:51
Elapsed Time: 000:01:54
Expiration Time: 10/09/2007 01:09:51
Compressed: no
Encrypted: no
Kilobytes: 32
Number of Files: 0
Primary Copy: 1
Image Type: 0 (Regular)
Keyword: (none specified)
Ext Security Info: no
File Restore Raw: no
Image Dump Level: 0
File System Only: no
Object Descriptor: (none specified)
Multiplexed: yes
TIR Available: no
Backup Copy: Standard (0)
The desired output is:
Client Policy Date Time Run Time MB # of Files
=========================================================================================
server1 virtualHosts_group1 09/25/2007 01:09:51 000:01:54 0 0
Where for each server has the time and MB added together for every iteration found in the file.
So if there are 5 backups for server1, the total backup time and MB will be added up.
I have a current awk script that parses the file, but does not add up the numbers for the total time and MB if there are multiple iterations for different backups.
Any help will be greatly appreciated.
Thanks,
John