Wrote a batch file to write the logs to the Windows event viewer
Requirements:
--Free file sync must be set to save last 2 logs only
--Log location must be c:\logs
The logs are written to:
Log Name: Application
Source: FFSync
Event ID for error 1 - Warniing
Event ID for Success 2 - Informational
I created this so that I can pull the event monitors to my RMM platform and create tickets for errors
Free to use and improve by all
DEL "C:\logs\%computername%.txt" cd\logs DIR /S /B *error* >> "C:\logs\%computername%.txt" SET file="C:\logs\%computername%.txt" SET /a cnt=0 for /f %%a in ('type "%file%"^|find "" /v /c') do set /a cnt=%%a IF %cnt% GTR 0 ( eventcreate /l APPLICATION /t WARNING /so FFSync /d "There are FreeFileSync errors" /id 1 ) IF %cnt% EQU 0 ( eventcreate /l APPLICATION /t INFORMATION /so FFSync /d "There are NO FreeFileSync errors" /id 2 )
I need to have an email after sync both when it is positive and when it is negative.
I tried to use this script but i have some problem.
If i run manually (double clic on the icon) the Batch Job of FreeFileSync, all is ok. But if i insert an automatic operation in the windows scheduler task, i received a Sync Error on the Event Viewer.