Pre-Post Drive Commands

This tool provides the ability to run customized scripts to gather information before or after drive load and unload phases from the command line.

The pre-post drive commands are supported for the Unix and Windows MediaAgents.

Set Up Pre-Post Drive Commands

The pre-post drive commands can be setup by running an executable from the command prompt, available in the following locations:

  • Windows: <Software Installation Path>\Base\AddPrePostCmdForDrives.exe
  • Unix: <Software Installation Path>/Base/AddPrePostCmdForDrives.exe

This is menu driven program and can be used both to add or remove a pre-post drive command. This program will prompt you for the following information:

  1. The name of the library.
  2. Whether the command must be run on a specific drive or all drives.
  3. The phase in which the command must be run. Available phases are preload, postload, preunload or postunload.
  4. If you had previously added a command,  whether you wish to add or remove a command.
  5. The path to the script or executable that must run.
  6. Any additional argument that may be required to run the script or executable. The following arguments can be added to the script or executable:

    %DriveName

    %LibraryName

    %DriveAccessPath

    %DriveSerialNo

    %MediaAgent

    %JobID

  7. For Windows, the user impersonation details that must be used to execute the script or executable, such as the user name, password and/or domain name. User impersonation is not applicable for Unix.

The command will be saved in the following location and will be automatically executed during the specified phase of the drive load/unload operations:

  • Windows: <Software Installation Path>\MediaAgent\PrePostDriveCmd.txt
  • Unix: <Software Installation Path>/MediaAgent/PrePostDriveCmd.txt