Skip to main content

Ensure correct tape is inserted from an external script

Thread needs solution

For a customer we need to check before the daily backup (e.g. 2h before), if a tape is inserted and if that tape is the correct one (e.g. on Tuesday the Tuesday tape). If not an E-Mail should be sent to a list of relevant persons in order to correct that situation.

Does Acronis offer an API or a command line tool (like acrocmd) we can use from an external script (e.g. Python or JavaScript) to accomplish that? We have inventorized all tapes and have given each one a meaningful name (e.g. "Tuesday")

If this is not possible does someone have another idea how we can fulfill that customer request?

Thanks for your help!

 

0 Users found this helpful

Hi,

you can utilize the acrocmd as you mentioned, the Documentation provide some examples how to use it correctly.

Please refer to Command-line reference and Examples.

You could use a script to query the backup plans and find the start time of next backup. It should be trivial to find out which tape (day) must be inserted.

Hi Raphael,

i've checked the reference and therefore also the "list plans" command. But there (and also with any other commands) i don't see

  • if a tape is inserted in the tape drive and
  • what's the name of the inserted tape

The external script would know which tape needs to be inserted for every day and then could compare with the information i'm trying to retrieve with an acrocmd (or similar) call.

Hm, there are examples Operations with tapes, is it helpful?

Are you working with Windows or Linux, which tape loader?

 

 

We run Acronis on Windows Server 2012 R2, where the tape device is a HP Ultrium 6.

I have to check if the "Label" property i can retrieve with "acrocmd list tape_slots" refers to the name of the inserted tape.

If not maybe we could also get the needed information directly from the tape device itself without querying Acronis.

Unsure if the wmic command will correctly handle tape drives: wmic diskdrive list brief /format:list

There are some attributes to query: https://msdn.microsoft.com/en-us/library/windows/desktop/aa394132%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

In particular: MediaLoaded, Name

Edit: There is also a TapeDrive class wich will provide additional information: https://msdn.microsoft.com/en-us/library/windows/desktop/aa394491(v=vs.85).aspx

Something like should do the job: wmic tapedrive get Name, Capabilities, Compression, Description, MediaType, NeedsCleaning, Status, StatusInfo

I have discovered TapeDrive class as well meanwhile :-)

I will check what i get back when a tape is inserted. What i see so far is a lot of information about the tape device itself, but not about a tape inserted...

Let's see, i let you know. Thanks meanwhile!

Unfortunately i do not get any information about an inserted tape, not with an acrocmd nor the wmic command.

All information is just about the tape drive itself.

 

There are HP's HPE Library and Tape Tools, a command line interface is included but no description about media info. Some notes about cartridge info in GUI mode only.

Also found a Tape Detection Tool from Acronis.

Otherwise it must be possible to utilize some Windows tools to get that information, unfortunately I cannot test as I don't own a tape loader.

Thank you so much for your help, Raphael.

I guess that i've found a solution now: Since changing a tape in the device is not automatically discovered by Acronis i have to perform a fast inventory followed by the "list tape_slots" command.

With these 2 commands i can get the label of the currently inserted tape!

Thanks for reporting your solution!