cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-Eject tapes that arent expired Media

Justin_Brooks
Level 4

Without using a 3rd party tool (or perhaps with), is there a way, where as soon as I place tapes in the library, and run an Inventory, that NetBackup will read the tapes, and anything that is NOT expired/scratch, automatically export to the MAP(media access portal)

 

Example:

 

I load 30 tapes into the library,

27 have expired rentention , and are scratch

3 were written to last week, and have 28 days to go.

Netbackup does inventory of Robot, and then kicks back out the 3 tapes to the MAP

 

Thanks!

12 REPLIES 12

mph999
Level 6
Employee Accredited

Only way this can be done is via a custom script.

nbemmcmd -listmendia -mediaid <maedia id> output will give required info.

If Robot Type is not equal to NONE AND there is a Time Assigned than the tape should be ejected.

The vmchange command can be used for this.

 

Martin

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

There is nothing in NBU that will automatically do this. I cannot even think how you would script something like that!

But why would you in the first place put non-expired tapes back in the robot?

If you keep an eye on Media Summary report (Verbose mode) you will know when images expire and only put Scratch tapes back in the robot.

What is your concern about the non-expired tapes? That new backups will be appended to the tapes?

Justin_Brooks
Level 4

Marianne,

   3rd party handling of tapes, and just in case human-error...

 

Mph999

  - Would that script only list what isnt expried? not actually perform an export task?

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

3rd party handling of tapes, and just in case human-error...

What kind of human error?

Are you scared that tapes will be overwritten?
NBU will merely append. Not overwrite.

 

mph999
Level 6
Employee Accredited
It depends how you write it but it could eject if you want to.

Justin_Brooks
Level 4

ok... would my best bet, to engage support direct and test out a script?

Mark_Solutions
Level 6
Partner Accredited Certified

The AUTO_UPDATE_ROBOT in your vm.conf would automatically cause tapes to be loaded once they were put into the map - you could then run a script to then query the tapes and eject what you do not want.

A vmquery command against the robot type and number would then pipe out what is in the library - you then need to query that and use vmchange to eject those with a time assigned value

I would have thought that would be a professional services task rather than a support task to be honest - or someone on here with the time and good will to write it for you!

Justin_Brooks
Level 4

Mark,

 

Goodwill is right!! trying to think of a shared value, i could offer, and chances are a person that could write this, already has the knowledge i could share :)

 

then again, I got some great NFL picks for this weekend, i could share :)

watsons
Level 6

Support will not create customized script for you, they can only point you to what commands you can use to achieve that script, on your own.

From what I can see here, a few of these commands might be vmcheckxxx, bpmedialist and vlteject etc.

mph999
Level 6
Employee Accredited

What OS is the Master server, If unix/ linux I can probably write something given a bit of time ....

mph999
Level 6
Employee Accredited

OK, this is a very basic way of doing it :

NOTE:

This assumes you have one robot (at the moment, set for TLD type and robot 0)

If there are multiple robots it gets a bit harder and you have to capture the robot number for each media and then work out the robot control host - that is quite a bit of work, or at least I think it is.

I wrote it on Solaris using ksh - Linux may require a bit of alterantion, not sure as I have no Linux box right at this second.

#!/usr/bin/ksh
 
>/tmp/robotic_media.txt
>/tmp/eject_medialist.txt
 
ROBOT_NUM=0
ROBOT_TYPE=tld
 
vmquery -a |grep "media ID" |awk -F: '{print $2}' |sed "s/^[ \t]*//" |while read MEDIAID
  do
     if [[ $(echo $(vmquery -m $MEDIAID |grep -i  "Robot Type" |awk -F: '{print $2}' |sed "s/^[ \t]*//")) != "NONE - Not Robotic (0)" ]]
       then
         echo $MEDIAID >>/tmp/robotic_media.txt
     fi
  done
 
cat /tmp/robotic_media.txt |while read ROB_MEDIAID
  do
   if [[ $(echo $(vmquery -m $ROB_MEDIAID |grep -i  "Assigned" |awk -F: '{print $2}' |sed "s/^[ \t]*//")) = "---" ]]
     then
     echo $ROB_MEDIAID >>/tmp/eject_medialist.txt
   fi
 done
 
LISTMEDIA=""
cat /tmp/eject_medialist.txt |while read i
  do
    LISTMEDIA=$LISTMEDIA:$i
  done
echo "vmchange -res -multi_eject -verbose -rn $ROBOT_NUM -rt $ROBOT_TYPE -single_cycle -w -ml $(echo $LISTMEDIA |sed 's/^://')"
 
 
Martin

Justin_Brooks
Level 4

WOW!

good stuff, ill be in touch