cancel
Showing results for 
Search instead for 
Did you mean: 

Error while performing duplication

Sm
Level 3

Please advise on below error while performing duplication.

 

 /usr/seos/bin/sesudo bkuptapedupimages.pl -t C05582

an invalid entry was encountered

Usage: vmquery [-h <volume_database_host>,...,-h <volume_database_host>]

[-b | -w | -W | -l]

{

-a |

-m <media_id> |

-v <volume_group> |

-rn <robot_number> |

-rt <robot_type> |

-mt <media_type> |

-p <pool_number> |

-pn <pool_name> |

-vltcid <vault_container_id> |

-res <robot_type> <robot_number> <robot_control_host>

<robot_coord1> <robot_coord2> |

-assignbyid <media_id> <media_type> <pool_number> <status>

<assigntime> |

-deassignbyid <media_id> <pool_number> <status>

}

CAUTION: The act of unassigning volumes may lead to inconsistencies

between the application media database and volume database,

leading to the possibility for data loss. You must expire the

media from an application interface.

7 REPLIES 7

Mojo_Magix
Level 3
Is this a PERL script or a canned NetBackup command? If it's a PERL script, can you show us the content?

Sm
Level 3
Hi Friend,
 
This is a Perl Script made to perform Duplication,We are now trying to perform bpimport phase1 on this tape & attempt to Duplicate the same.Many Thx for quick response :)

Stumpr2
Level 6
your "error" message concerns an invalid usage of the command vmquery. Check the command string to see what is not a valid argument. The line includes a "-t" perhaps it is suppose to be "-mt" which is VALID for vmquery
 
bash-2.05$ sudo vmquery -help
unrecognized option -help
Usage: vmquery [-h <volume_database_host>,...,-h <volume_database_host>]
          [-b | -w | -W | -l]
          {
          -a |
          -m <media_id> |
          -v <volume_group> |
          -rn <robot_number> |
          -rt <robot_type> |
          -mt <media_type> |
          -p <pool_number> |
          -pn <pool_name> |
          -vltcid <vault_container_id> |
          -res <robot_type> <robot_number> <robot_control_host>
               <robot_coord1> <robot_coord2> |
          -assignbyid <media_id> <media_type> <pool_number> <status>
                      <assigntime> |
          -deassignbyid <media_id> <pool_number> <status>
          }
CAUTION: The act of unassigning volumes may lead to inconsistencies
        between the application media database and volume database,
        leading to the possibility for data loss. You must expire the
        media from an application interface.

Message Edited by Bob Stump on 04-09-200707:23 AM

Rakesh_Khandelw
Level 6
Definitely syntax error with vmquery command. Look into your script to check what are you trying to perform with vmquery command.


There isn't any need to run vmquery to perform duplication of a tape. What all this script does other than duplication?
Is this a script which was woking in 5.x environment and now you brough it to 6.0 and running into issues?

Message Edited by Rakesh Khandelwal on 04-09-200709:17 AM

Sm
Level 3
Hi Rakesh,
 
I guess you got that one,the script was actually moved from Netbackup 5.x to Netbackup 6.x .Can you Advise further.
 
BTW Thankyou guys.I feel very glad i joined this forum :)

Rakesh_Khandelw
Level 6
You will have to send your script contents to look at (copy and paste).

Sm
Level 3
It pretty big Script Rakesh.I am pasting a part of it,Let me know if this will help
######################################################
#                                                    #
# GetImageInfo sub routine to get backup image       #
# data and input into db                             #
#                                                    #
######################################################
sub GetBackupIDs {
 $VerifyTapeExists=`vmquery -m $MediaID -l 2>&1`;
#   print ERRORLOG "Debug Line vmquery output $VerifyTapeExists\n";
 if ($VerifyTapeExists =~ "volume does not exist") {
  print ERRORLOG "$MediaID does not exist in $MEDIAMGR volume database\n";
  # Put end time into log file
   $SCRIPTTIME=`date`;
   chomp $SCRIPTTIME;
   print ERRORLOG "\n$SCRIPTTIME bkuptapedupimages.pl script ended\n";
   exit(14);
 } # if $VerifyTapeExists
 (@MediaInfo)=split(/\s+/,$VerifyTapeExists);
# As tape exists, verify that it is still assigned
 if (@MediaInfo[19] =~ "00/00/0000") {
  print ERRORLOG "$MediaID is not assigned so NBU catalogue has no images to duplicate.\n";
  # Put end time into log file
  $SCRIPTTIME=`date`;
  chomp $SCRIPTTIME;
  print ERRORLOG "\n$SCRIPTTIME bkuptapedupimages.pl script ended\n";
  exit(14);
 } # if (@MediaInfo[19]
# Subtract 7 days from assigned date for image query
# Add 7 days to last mount to set end time for image query
# verify date diff of Start and End time, if over 30 days then break out into multiple queries
 $GetStartTime = &DateCalc("@MediaInfo[19]", "-7 days", \$err);
 chomp $GetStartTime;
 $SDate = substr($GetStartTime, 0, 8);
 $syear = substr($SDate, 0, 4);
 $smon = substr($SDate, 4, 2);
 $sday = substr($SDate, 6, 2);
 $adjsyear=$syear;
 $adjsmon=$smon;
 $adjsday=$sday;
 $StartTime="$smon/$sday/$syear 00:00:00";
 $AdjStartTime="$smon/$sday/$syear 00:00:00";
 $GetEndTime = &DateCalc("@MediaInfo[23]", "+7 days", \$err);
 chomp $GetEndTime;
 $EDate = substr($GetEndTime, 0, 8);
 $eyear = substr($EDate, 0, 4);
 $emon = substr($EDate, 4, 2);
 $eday = substr($EDate, 6, 2);
 $EndTime="$emon/$eday/$eyear 23:59:59";
 $SearchDeltaDays=Delta_Days($syear,$smon,$sday,$eyear,$emon,$eday);
 print ERRORLOG "The delta days of the search is $SearchDeltaDays\n";
 while ($SearchDeltaDays >= 1) {
   ($adjeyear,$adjemon,$adjeday)=Add_Delta_Days($adjsyear,$adjsmon,$adjsday,30);
   $AdjEndTime="$adjemon/$adjeday/$adjeyear 23:59:59";
   print ERRORLOG "$NBUADMCMD/bpduplicate -PM -id $MediaID -s $AdjStartTime -e $AdjEndTime 2>&1\n";
   my ($IMAGEIDS) = FileHandle->new("$NBUADMCMD/bpduplicate -PM -id $MediaID -s $AdjStartTime -e $AdjEndTime 2>&1 |");
   while (<$IMAGEIDS>) {
     if ($_ =~ "found no images") {
       print ERRORLOG "$_ \n";
       $ValidQuery='Y';
     } elsif ($_ =~ "unexpected return value") {
       print ERRORLOG "Query failed, reattempting \n $_ \n";
       $ValidQuery='N';
     } else {
       push (@BKUPIDS,$_);
       $ValidQuery='Y';
     } # if $_
   } # while
   $IMAGEIDS->close;
   if ($ValidQuery eq "Y") {
     $adjsyear=$adjeyear;
     $adjsmon=$adjemon;
     $adjsday=$adjeday;
     $AdjStartTime = "$adjsmon/$adjsday/$adjsyear 00:00:00";
     $SearchDeltaDays=Delta_Days($adjsyear,$adjsmon,$adjsday,$eyear,$emon,$eday);
   } #if $ValidQuery
  } # while
 if (!@BKUPIDS) {
   print ERRORLOG "No backup images found for tape $MediaID in date range of $StartTime to $EndTime\n";
   exit (16);
 } # if !@BKUPIDS
  return @BKUPIDS;
} # sub GetBkupIDs