cancel
Showing results for 
Search instead for 
Did you mean: 

vmchange script

SARA_8
Level 4

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

1 ACCEPTED SOLUTION

Accepted Solutions

Mark_Solutions
Level 6
Partner Accredited Certified

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.

View solution in original post

6 REPLIES 6

Yasuhisa_Ishika
Level 6
Partner Accredited Certified

vmchange does not require user to enter password.
This must be required by pbrun.

revarooo
Level 6
Employee

Sara, 

This is not a NetBackup question, but a shell scripting question.

mph999
Level 6
Employee Accredited

This would break your companies security 'procedures' - therefore I wouldn't even recommend even thinking about this.

Martin

Mark_Solutions
Level 6
Partner Accredited Certified

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

 

SARA_8
Level 4

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 smiley

 

Mark_Solutions
Level 6
Partner Accredited Certified

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.