Revolving around the core of technology
Document ID: | 1893 |
---|---|
Subject: | Syncrify backup job hooks |
Creation date: | 10/28/11 2:33 PM |
Last modified on: | 11/12/18 12:17 PM |
Variable name | Description |
---|---|
$EVENT | This value can either be true or false It will be true when the script is called when a job is started and false when the script is called when job is complete. |
$CLIENT_IP | IP address of the client |
$CLIENT_BUILD_NO | Build number of the client |
$PROFILE | Name of the profile. If the profile name contains a space, it will be replaced by an underscore. |
$USER | User's email address |
$FILE_COUNT | Total files. This value is always 0 when $EVENT is true. |
$BYTE_COUNT | Total bytes. This value is always 0 when $EVENT is true |
$JOB_ID | An integer representing the job. This number is repeated after Syncrify server is rebooted |
<parameter name="jobHookScript" type="1" value="C:/temp/testHook.bat $EVENT $CLIENT_IP $CLIENT_BUILD_NO $PROFILE $USER $FILE_COUNT $BYTE_COUNT"></parameter>
echo %1 %2 %3 %4 %5 %6 %7 %8 %9 >> c:\temp\hookResult.txtThis script will write space separated data to C:\temp\hookResult.txt
if "%1"=="false" goto finishThis example runs JobStarted.exe when a job starts and JobCompleted.exe when a job ends. In both cases, the .EXE file is passed 3 parameters: Client's IP address, Profile name and user's login.
start c:\Data\JobStarted.exe %2 %4 %5
goto done
:finish
start c:\Data\JobCompleted.exe %2 %4 %5
:done
Do you have a helpful tip related to this document that you'd like to share with other users?