02-21-2012 09:03 PM
I have a script to eject multiple tapes every week using vmchange. I dont have a root access on the master but I can run the command using pbrun
cat eject.sh
*
*
*
pbrun vmchange .....
each time I run the script , it asks me for my password then it executes fine.
./eject.sh
Password for ....
is there a way to automate the script to read my password from a file or something without me interacting with the script each time I run it.
Sincerely, Sara
Solved! Go to Solution.
02-27-2012 02:35 AM
You could add a further line that runs a command to pipe out the used tapes and then use that in my script .... but in view of exactly what you want I think you should consider purchasing the Vault option that will do this for you.
02-21-2012 11:50 PM
vmchange does not require user to enter password.
This must be required by pbrun.
02-22-2012 12:07 AM
Sara,
This is not a NetBackup question, but a shell scripting question.
02-22-2012 12:19 AM
This would break your companies security 'procedures' - therefore I wouldn't even recommend even thinking about this.
Martin
02-22-2012 03:31 AM
Why not just install a WIndows Admin Console on your PC and run all command from there
Create a batch file named tape_eject.bat and in it put the following - ensuring anything between the <> symbols matches your envorinoment - (and then remove the <>):
for /f "tokens=1,2" %%a in (eject_tapes.txt) do "<installpath>\netbackup\volmgr\bin\vmchange" -res -m %%a -mt <HCART> -rh <robothostname> -rt <tld> -rn <0> -h <emmservername>-rc1 %%b -e -sec 1
"<installpath>\veritas\volmgr\bin\vmupdate" -rt <TLD> -rn <0> -rh <robothostname> -h <emmservername> -use_barcode_rules
Create a text file named tape_eject.txt and put it in the same directory as the .bat file you have just made.
In your library view in the GUI sort your columns so that the first column is the MediaID and the second column is the Slot Number.
Highlight the tapes you want to eject and hit CTL-C to copy the information.
Paste it into the text file and save it.
Run the .bat file. This will eject the tapes in the list and also update the inventory in NetBackup once it has finished.
Dont put more tapes in the list than you have eject ports though!
Hope thie helps
02-25-2012 09:10 PM
Thanks, but the goal of the script is to fully automate the process of ejecting tapes every week.
If someone has a solution I will be soo thankful
02-27-2012 02:35 AM
You could add a further line that runs a command to pipe out the used tapes and then use that in my script .... but in view of exactly what you want I think you should consider purchasing the Vault option that will do this for you.