Forum Discussion

brupnick's avatar
brupnick
Level 4
15 years ago
Solved

Pass Variables to bemcmd.exe

Rather than use the "Eject media after job completes" option, each of my backup jobs has a post-command that looks something like this:

"C:\Program Files\Symantec\Backup Exec\bemcmd.exe" -o115 -d"HP 1"

(In case you're wondering, the reason for this is because I have configured this post-command to only run when the job completes successfully, something that I don't think is possible using the Eject checkbox.  This allows me to rerun the job remotely if necessary without re-inserting the tape).

My question is this: Is it possible to pass a variable to the command line that will reference the drive name that was used for the job?  That is, instead of passing the line above, is there something like

"C:\Program Files\Symantec\Backup Exec\bemcmd.exe" -o115 -d"%DRIVE_NAME%"

that I could specify in all of my jobs, regardless of which drive they use?  What I'm doing now works fine until I need to run one of my jobs against a different drive than normal.

Thank you!!

  • Sorry.  I misunderstood your question.

    There is no global variable that you can use, but you can use the BEMCMD -o68 switch to enumerate your devices.  Parse the output to get the device name of your tape drive and use that to construct the BEMCMD command that you want. 

5 Replies

  • Yes, you can.  Just create a batch job so that will accept the tape name as an input variable and then use that variable to construct your BEMCMD command.

  • Thanks pkh, but does that really buy me anything?  I still have to manually specify the name of the device, the only difference is that I'm passing it to a script, rather than directly to bemcmd.

  • Sorry.  I misunderstood your question.

    There is no global variable that you can use, but you can use the BEMCMD -o68 switch to enumerate your devices.  Parse the output to get the device name of your tape drive and use that to construct the BEMCMD command that you want. 

  • You will probbaly have to work out of one of the bemcmd option for the startus of the last job (or last job by name)  provides the infoprmation on the drive used and then parse that output fopr the required infor before using the result in the next calling of bemcmd - this woul all have to be done with scripting outside of Backup Exec there is nothing within Backup Exec to do it.

     

    Might be a good idea for you to use the Ideas option (at the bottom of the foums menu on this site) to suggest an enhancement for eject media only when job reports sucess. so that we can get an idea of how many customers woudl liek that feature and then  plan it for a future version.

  • Thanks guys.  I'll look into the -o68 command and see what I can come up with.