Forum Discussion

Trinee_BE's avatar
Trinee_BE
Level 4
12 years ago

BE Command Line interface

Can some one please help me on how to label a tape using BEMCLI? I verified the documents, still i am not clear. If possible can someone send me the screenshoot of executing the commands?

  • Try this if you are using a stand-alone tape drive

    Get-BETapeDriveDevice "hp1" | Submit-BELabelMediaJob -Label <label>

    where <label> is the label string.  Change hp1 to your tape drive name in BE.

     

    If you are using a tape library, you would first have to get the slot that you want using the BEMCLI cmdlet

    Get-BERoboticLibrarySlot

    and then filtering the result.  After that, use the cmdlet in this format

    Submit-BELabelMediaJob -RoboticLibrarySlot <BERoboticLibrarySlot> -Label <String>

    If you are using barcode labels, then there is no need to label your tapes.  They would automatically be labeled with the barcode label.

  • Try this if you are using a stand-alone tape drive

    Get-BETapeDriveDevice "hp1" | Submit-BELabelMediaJob -Label <label>

    where <label> is the label string.  Change hp1 to your tape drive name in BE.

     

    If you are using a tape library, you would first have to get the slot that you want using the BEMCLI cmdlet

    Get-BERoboticLibrarySlot

    and then filtering the result.  After that, use the cmdlet in this format

    Submit-BELabelMediaJob -RoboticLibrarySlot <BERoboticLibrarySlot> -Label <String>

    If you are using barcode labels, then there is no need to label your tapes.  They would automatically be labeled with the barcode label.

    • jonessco's avatar
      jonessco
      Level 2

      This is great info.  I have a batch file that I've used in the past to batch label tapes in BUE2010.  I can use it as a starting point but how do I call the Submit-BELabelMediaJob -RoboticLibrarySlot <BERoboticLibrarySlot> -Label <String> from a command line?  I don't want to manually have to go into BEMCLI from the start menu but call a batch to loop and label a group of tapes in the auto loader.

      Found this but I'm guessing there's syntax errors cause it's failing.

      cmd.exe /c "powershell.exe -command "& {import-module bemcli;Get-BERoboticLibraryDevice  | Get-BERoboticLibrarySlot -SlotNumber 1 | Submit-BEEraseMediaJob -Confirm:$false | wait-bejob}""