Video Screencast Help

Auto-Eject tapes that arent expired Media

Created: 12 Sep 2013 | 12 comments

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!

Operating Systems:

Comments 12 CommentsJump to latest comment

mph999's picture

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

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
Marianne's picture

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?

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

Justin Brooks's picture

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's picture

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.
 

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

mph999's picture

It depends how you write it but it could eject if you want to.

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
Justin Brooks's picture

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

watsons's picture

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.

Mark_Solutions's picture

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!

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

Justin Brooks's picture

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 :)

mph999's picture

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

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
mph999's picture

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

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805