cancel
Showing results for 
Search instead for 
Did you mean: 

problem when bpdbjobs output contains commas

sclind
Moderator
Moderator
   VIP   

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

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

spitman
Level 5

Back to the Windows thing... if you are using powershell, there is a command similar to cut called "split"... this page talks about it...

http://www.fiveminutes.eu/powershell-tips-for-bash-users/

View solution in original post

Mark_Solutions
Level 6
Partner Accredited Certified

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!!

View solution in original post

7 REPLIES 7

spitman
Level 5

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.

spitman
Level 5

(obviously remove the |head part, I was using that for testing so I wouldn't get 10,000 lines of output lol)

sclind
Moderator
Moderator
   VIP   

I didnt mention it but this happens to be a Windows master server so the cut option is not available to me.

Andy_Welburn
Level 6

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

sclind
Moderator
Moderator
   VIP   

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.

spitman
Level 5

Back to the Windows thing... if you are using powershell, there is a command similar to cut called "split"... this page talks about it...

http://www.fiveminutes.eu/powershell-tips-for-bash-users/

Mark_Solutions
Level 6
Partner Accredited Certified

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!!