Server Connect and Disconnect Scripts

Agents attempt to connect to the Vault when they start. Once connectivity is established, they stay connected (online) until either the Agent is shut down, or until a communication problem breaks the connection (and then the Agent automatically switches to offline mode and starts an endless series of re-connect attempts).

When an Agent connects to the Vault, it is considered a "connect" event. Likewise, at the time that the Agent stops being connected, it constitutes a "disconnect" event.

In addition to Agent connects and disconnects, there is also a "diskOff" event, occurring when the disk on which the Vault files reside is unavailable, or any of its directories are unavailable. This might happen if the disk is detachable, is iSCSI or SAN and becomes disconnected, etc.

What are "connect" and "disconnect" scripts?

If your Vault is licensed for the failover option, you can provide two scripts that would be run automatically by the Vault after a connection or disconnection event. The scripts are stored in the folder _Scripts (which you must create) under the Vault's working space folder. For example, if the Vault's working space folder is C:\Vault Data, then the scripts folder would be C:\Vault Data\_Scripts. The connection and disconnection scripts, if they exist, have to be named connect.bat and disconnect.bat.

These scripts are optional; if there is no script for a given event, then there is no special user-provided processing done at that time.

The connect script is called when an Agent connects to the Vault. It is called with three parameters, all quoted (i.e., the double-quotes are passed into the BAT file):

The disconnect script is called when the connectivity with a given Agent is lost. It is called with four parameters, all quoted (i.e., the double-quotes are passed into the BAT file):

If your Vault cannot reach any of the folders on which data is stored, it automatically aborts all replication, and refuses any new connection requests. It stays in this mode until an operator acknowledges the situation.

When a "diskOff" event occurs, the Vault runs file C:\AvaillDiskOff.bat (if it exists), with a single argument being the folder that was not accessible when the event happened. Note that the script should be placed at the root of the C drive and not in the scripts folder. If the disk with the scripts folder is unavailable, it is still desirable to be able to locate the "diskOff" script.

What should the scripts do?

There are many applications for the scripts, limited only by the user's imagination. However, there are two common uses:

  1. Notification. For example, you can write a disconnect script that sends an automatic e-mail every time an Agent disconnects. You can qualify the type of disconnect using the third parameter, and only send an e-mail if the reason for the disconnect is unplanned.

  2. Setting the replication mode of one or more Jobs on an Agent colocated with the Vault on the same computer.

    For example, in backup situations, you will likely have the Vault and a backup "slave" Job on a remote computer, and a backup "master" on another computer. If the connectivity with the master is severed, you may want to switch the mode of the "slave" backup Job to "master" automatically so that users can failover to that computer and keep having full read/write access to the files. In fact, you can even switch the mode to "WAFS."