09-10-2014 11:36 AM
I have a script that runs bpdbjobs -all_columns and parses the output based on being comma delimited. But now I run into problems when I see that sometimes a column contains commas:
BACKUP C:\ USING \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1754\ OPTIONS:ALT_PATH_PREFIX=D:\Program Files\VERITAS\NetBackup\temp\_vrts_frzn_img_15504_1,FITYPE=MIRROR,MNTPOINT=C:\,FSTYPE=NTFS
So the single column gets split into multiple columns at the commas.
Anyone have a good solution for this?
Scott
Solved! Go to Solution.
09-12-2014 08:34 AM
Back to the Windows thing... if you are using powershell, there is a command similar to cut called "split"... this page talks about it...
09-12-2014 09:04 AM
I am assuming that you parse it as a csv so that you can open it in excel?
So the easy (LOL!!) way is to actually do a macro for excel that extracts all of the rubbish to leave the good stuff for you.
So a button maybe that uses a user form that reads each line and looks for BACKUP C:\ USING or FITYPE= or MNTPOINT= etc.
As a new thing crops up you can add to your macro loop check .. that leaves you a nice clean spread sheet once the macro has run that you can drop into your daily sheet.
We offer this type of thing as a service for some customers so i could do it all for you but i would have to charge you for it!!
09-10-2014 01:32 PM
Someone else may have a better answer; but I think everything after about comma 44 is the detailed job status output... so in just a one-liner, here's a suggestion of how to handle that output:
bpdbjobs -all_columns | head | cut -d"," -f44-
That would show *just* that ending output. You could do the reverse for the first 44 columns etc.
09-10-2014 01:33 PM
(obviously remove the |head part, I was using that for testing so I wouldn't get 10,000 lines of output lol)
09-11-2014 07:33 AM
I didnt mention it but this happens to be a Windows master server so the cut option is not available to me.
09-11-2014 07:48 AM
Do you actually need "all columns"?
How to customize the output of the bpdbjobs -report command with a Windows Master Server.
http://www.symantec.com/business/support/index?page=content&id=TECH46268
09-11-2014 08:33 AM
I could maybe get away with not having the 'files' columns but unfortunately on Windows this is accomplished by changing the registry - which of course is a global change. On Unix I can make a copy of the bp.conf file that only I would reference in my PATH.
I wish the Windows developers and the Unix developers would implement things the same way. Sigh.
09-12-2014 08:34 AM
Back to the Windows thing... if you are using powershell, there is a command similar to cut called "split"... this page talks about it...
09-12-2014 09:04 AM
I am assuming that you parse it as a csv so that you can open it in excel?
So the easy (LOL!!) way is to actually do a macro for excel that extracts all of the rubbish to leave the good stuff for you.
So a button maybe that uses a user form that reads each line and looks for BACKUP C:\ USING or FITYPE= or MNTPOINT= etc.
As a new thing crops up you can add to your macro loop check .. that leaves you a nice clean spread sheet once the macro has run that you can drop into your daily sheet.
We offer this type of thing as a service for some customers so i could do it all for you but i would have to charge you for it!!