GoodSync contains an extensive email notification and reporting suite that can be used to issue alerts for your job runs.
To configure email notifications, go to Job Options >> Scripts. Here you will notice 3 fields that can be used as triggers for alerts.
- Pre analyze – send a notification before the job runs.
- Post analyze (no change) – send a notification after an Analyze when no changes were detected.
- Post sync – send a notification after a synchronization.
Several prefixes may also be used to further configure when and how these 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 may also 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 your email 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 only prefer to receive the customized notification, you may use the “noattach:” prefix.
e.g. noattach: test@email.com: The result of job %JOBNAME% is %RESULT%
For GoodSync to have the ability to send out email notifications, you may specify your SMTP settings under Tools >> Program Options >> Connection (On Mac: GoodSync >> Preferences >> Connection).
For more information on this process, click here.
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)
Else
Set filetxt = filesys.CreateTextFile("C:/Users/YourUser/Desktop/log.txt", true)
End If
For Each arg In args
filetxt.Write arg & " "
Next
filetxt.WriteLine("")
filetxt.Close