The scripts tab may be used to call a program, script, or email alert during a certain phase of a job run.
Pre Analyze E-Mail or Program
If the option is not empty, then take the action specified just before Analyze begins.
If the program returns a non-zero return code or fails, do not start Analyze.
If the program succeeds and returns a zero return code, proceed with Analyze.
Post Analyze (No Changes) E-Mail or Program
If the option is not empty, take the action specified just after Analyze finishes.
The action is taken only if Analyze finishes with No Changes.
Post Sync E-Mail or Program
If the option is not empty, take the action specified just after Sync finishes.
Scripts: Sending Emails
If the Scripts option value contains the '@' symbol, then GoodSync sends an e-mail to the address(es) specified in the option.
Multiple email addresses must be separated by a comma or semicolon: user1@server.com; user2@hotmail.com
If only emails are specified in the field(s), a default email text is sent.
To specify custom emails, you may prepend with some of the following options:
Example:
noattach: user@siber.com: Synced %SYNCOK% items, changed items were %CHANGED%
Here 'noattach" ' specifies that a sync log will not be attached to the email, the email will be sent to user@siber.com, and the email will contain parameters %SYNCOK% (number of files/folders synced OK) and %CHANGED% (number of changed items synced OK).
Scripts: Calling Programs
If the Scripts option value contains no '@' GoodSync runs the program specified in the option and arguments passed to this program:
program-name %ARG1% %ARG2% %ARG3% ...
where arguments can be one of the following (all variable names are case-sensitive):
%JOBNAME% | job name |
%RESULT% | Result: "" for OK or "terminal error message" |
%LOGPATH% | Log file path in "..." |
%LF% | Left folder path in "..." |
%LF_ACT% | Resolved (=VolumeName\folder -> f:\folder) Left folder path in "..." |
%RF% | Right folder path in "..." |
%RF_ACT% | Resolved (=VolumeName\folder -> f:\folder) Right folder path in "..." |
%CHANGED% | Number of Changed Items in Post-Analyze |
%ERRORS% | Number of Errors in Post-Analyze or Post-Sync |
%CONFLICTS% | Number of Conflicts in Post-Analyze or Post-Sync |
%SYNCOK% | Number of Synced-OK items in Post-Sync |
Please use absolute paths to point to the location of the program or script.
If the program name contains spaces, it must be enclosed in double quotes like so:
"C:\Documents and Settings\John Smith\My Documents\myscript.vbs"
Example: call Notepad to show the log file:
notepad %LOGPATH%
If a script or email alert is prefixed with "errors:", it is started only if:
- Terminal Errors occurred in Analyze or Sync, OR
- Non-Terminal Errors occurred in Analyze or Sync, OR
- Conflicts occurred in Analyze.