When the Agent service starts up, shuts down, or connects or disconnects from a Vault, the Agent is capable of executing customizable scripts. These scripts must be located in the C:\Program Files (x86)\Globalscape\WAFS Agent folder on the computer running the Agent. None of these scripts exists by default, but if you create any of them, they will be executed by the Agent at the appropriate time. Typically, these scripts would be used for notifications, alert messages, email scripts, and so on. (See also Server Connect and Disconnect Scripts.)
If you need assistance creating scripts, contact the GlobalSCAPE Professional Services team.
At startup and shutdown, the Agent can run the following scripts:
pre_init.bat - This script runs before the Agent mounts its data, and before any replication activity starts.
post_init.bat - This script runs a few seconds after the Agent mounts its data and starts replication.
pre_shutdownC.bat - This script runs when the Agent is stopped; typically when the service is stopped. In other words, it runs before the Agent confirms (hence the "C") that no file in the folders is opened. The script can shut-down applications that open files on the Agent, so that stopping the Agent would proceed correctly. If later the Agent cannot be stopped (because a file is opened), and the IT manager makes another attempt to stop the Agent, the script is executed again.
pre_shutdown.bat - This script runs before the Agent starts the shutdown process. This script runs after the pre_shutdownC script.
post_shutdown.bat - This script runs after the Agent completes the shutdown process, stops all activities.
The scripts run at the appropriate time when the Agent service is started or stopped. They are not called with any arguments.
When the Agent connects to or disconnects from a Vault, it can run the following scripts:
srv_connect.bat - This script runs when the Agent is connected to a Vault and is passed the Vault's name.
srv_disconnect.bat - This script runs when the Agent is disconnected from a Vault and is passed the following arguments:
The Vault's name
The reason for the disconnection, which is one of:
"exit" - disconnect due to Agent exiting normally
"scheduledDisconnect" - Agent is on a schedule and disconnected accordingly
"disconnect" - generic error; Agent did not expect to be disconnected