05-28-2012 08:27 AM
Hi Dudes,
I have made a script to chk the media availability
Solved! Go to Solution.
05-29-2012 04:42 AM
whether it's temporary or not then it'll take just as long!
How are you determining which media that you want to check?
05-29-2012 04:51 AM
If no quoutes "Dude enter list of media id's to check" also no issue:) . But i dont want to go with editing of some file which is located in some other place and calling the file in script.
I know i am bothering you Gys. But really i need all your helps!!
Thanks & Regards,
Gopinath S
05-29-2012 04:54 AM
Actually some Customers will ask for restore
and we will get the media ids in the restore window. then by using vmquery or nbemmcmd will chk whether the tape is avilable in on site or not with the robo number. And valt date is needed when is the tape has vaulted. the last written host is importand to recall the media for the correct lib.
05-29-2012 04:57 AM
some other place and calling the file in script."
Put it in the same place as where you run the script from then you don't have to go to two different places!
It *really* isn't too much work, honestly.
Again, can I ask where you are getting your list of media that you're then wanting to copy and paste?
***EDIT***
Scrub that last - just seen your most recent post.
05-29-2012 05:01 AM
Hi Andy,
I think i Just realised you
Could you please give me the final structure of the script.
Thanks & Regards,
Gopinath S
05-29-2012 05:09 AM
Hi Andy
I have tried my self with u stated above
05-29-2012 05:16 AM
and sorry
it is
nbemmcmd -listmedia -mediaid $a | egrep 'Last Write Host|Robot Number|Date Vaulted'
not the below typo error
nbemmcmd -listmedia -mediaid $b | egrep 'Last Write Host|Robot Number|Date Vaulted'
05-29-2012 05:16 AM
https://www-secure.symantec.com/connect/forums/script-check-media-availability#comment-7193571
Altho' you *may* want to make the following amendment(s) (not totally necessary, but ...)
Say your script is media_availability.sh & is located in /somedirectorypath/myscripts
- your list of media (which you'd edit each time) would be /somedirectorypath/myscripts/tape.lst
- to be safe you *may* want to change one line in media_availability.sh slightly to cater for this i.e.:
cat /somedirectorypath/myscripts/tape.lst|
05-29-2012 05:21 AM
i.e. mediacheck.sh when run will look in the directory it is being run from to try & find tapes.lst, hence my post (that I wrote as you were testing!) to put in the absolute path to the location of the list of media.
As an aside, the only reason I wasn't happy with pasting a list of media into an actively running script, as I think you wanted originally, was because it throws a carriage return at the end of each media_id & I'm afraid that I just couldn't handle that with my scripting ability!
05-29-2012 05:22 AM
Hi Andy,
Thanks for your help!!
Now got u. I will check the o/p and get back to you.
Thanks & Regards
Gopinath S
05-29-2012 05:27 AM
Yes Andy you are right
with pasting a list of media into an actively running script, that is i wanted originally.
But i thank you for all your effort with my request.
Thanks Mate
05-29-2012 05:47 AM
Is there any ways to achive our goal using "sed"
05-29-2012 06:06 AM
The sed utility is a stream editor that reads one or more text files, makes editing changes according to a script of editing commands, and writes the results to standard output. The script is obtained from either the script operand string, or a combination of the option-arguments from the -e script and -f script_file options.
*May* be able to utilise it somewhere, but this is as far as I got with the utility - bookmarking the following & that was about it, never got the time to even start to research it properly!
http://www.grymoire.com/Unix/Sed.html
05-29-2012 06:21 AM
05-29-2012 06:54 AM
functionality to this script, but I feel that the amount of work involved just to run "as is" is minimal & acceptable from an administrative point of view.
If someone told me that to get the information that I required involved editting a file by pasting in a bunch of numbers & then running a script then I would say "Fine. No problem". I *still* feel that this method is as 'long-winded' as being told I needed to run the script then at a particular point I would need to paste in my list of numbers in order to get the information.
In all honesty I cannot see the advantage of pursuing any further options to make this a one-button functionality for what you are likely to gain in the long run - but that's just my point of view.
05-29-2012 08:52 AM
i agree with you Andy,
Thanks for your help!!. I have implemented wat u have given successfully. I need another script also.
I will post it in a new Title.
:)
Thanks for all the helping hands!!
Thanks & Regards,
Gopinath S