GoodSync contains an extensive email notification and reporting suite that can be used to issue alerts for your job runs.
NOTE: For GoodSync to have the ability to send out email notifications, you must specify your SMTP settings. For instructions and information on this process, click here.
To access the "Scripts" page and configure email notifications, follow these steps:
1) Open GoodSync and click "Options" in the upper right.
2) Select "Scripts."
How to Customize Email Notifications
On the Scripts page, you will notice 3 fields that can be used as triggers for alerts:
- Pre analyze – GoodSync will send a notification before the job runs.
- Post analyze (no change) – GoodSync will send a notification after an Analyze when no changes were detected.
- Post sync – GoodSync will send a notification after a synchronization.
Below those fields, you will see prefixes which may be used to further configure when and how notifications are sent.
- The “errors:” prefix will send an email only if an error occurs.
- The “nowait:” prefix allows emails to be sent without waiting for job completion.
- The “noattach:” prefix when used does not attach a log file to the email notification.
You also have the option to specify multiple recipients using “;” as a separator.
When sending notifications, you may customize which specific job details are provided in the email through the use of variables. This allows for full customization to make your alerts as detailed or as brief as desired.
To customize your email notification, simply enter the email you wish to send the notification to followed by “:”, and provide any of the variables seen below. The customized notification will appear in the subject and body of the email.
NOTE: If you would like to omit the full log from the job run and prefer to receive only the customized notification, you may use the “noattach:” prefix.
For example: noattach: firstname.lastname@example.org: The result of job %JOBNAME% is %RESULT%
Notifications can also be scripted to be written to a txt file on your computer instead of sent as an email. GoodSync supports any scripting or programming language supported by the operating system.
Below is an example of a VBS script being used to write the sync result of a job run to a text file.
For your convenience, you may copy and paste the script below into a text file and save it as "log.vbs". This will allow you to perform the described use case in your environment.
NOTE: Be sure to change "C:/Users/YourUser/Desktop/log.txt" to the location where you would like this log to be created and written to.
Set args = Wscript.Arguments
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("log.txt") Then
Set filetxt = filesys.OpenTextFile("C:/Users/YourUser/Desktop/log.txt", 8, True)
Set filetxt = filesys.CreateTextFile("C:/Users/YourUser/Desktop/log.txt", true)
For Each arg In args
filetxt.Write arg & " "