Backup4all creates a log file for each backup execution, log that can be also sent by email to a specified email address. Sometimes an administrator wants to get a single file with a daily report, including all Backup4all executions. This can be done from the Event Viewer service in Windows. This article explains how to obtain that report.
On this page:
Create a filter in Event Viewer
You can create a custom filter in Event Viewer and use it with another application to send the exported .xml by email.
- Go to Start -> Control Panel -> Administrative Tools -> Event Viewer
- Go to Windows Logs -> Application
- Press the “Filter current log” button from the right side column.
- On the "Logged" dropdown list, select “Last 24 hours”
- For “Event level” select the levels you want. In this example we selected only “warning” and “error”
- For “Event sources” select “Backup4all 8”
- Press OK
- Go to XML tab of the filter you created and copy the following part:
\[System\[Provider\[@Name='Backup4all 8'] and (EventID=%EVENT_ID%) and TimeCreated\[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]
Export the logs matching the Event Viewer filter
You can use the following batch to export the Event Viewer filter.
Create a new .bat file and put the following code inside.
::----------------------------------------------------------------
:: @echo off
SET dtDay=%date:~-4%-%date:~4,2%-%date:~7,2%
:: success events
SET EVENT_ID=256
:: warning events
:: SET EVENT_ID=258
:: error events
:: SET EVENT_ID=259
SET QUERY="*[System[Provider[@Name='Backup4all 8'] and (EventID=%EVENT_ID%) and TimeCreated[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]"
echo ^<?xml version="1.0" ?^> > todays_errors.xml echo ^<events^> >> todays_errors.xml wevtutil qe Application /q:%QUERY% /f:XML >> todays_errors.xml echo ^</events^> >> todays_errors.xml
::-------------------------------------------------------------
The following line is from the Windows Event filter you created, you can find it on the xml tab. Replace it with your filter.
*[System[Provider[@Name='Backup4all 8'] and (EventID=%EVENT_ID%) and TimeCreated[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]"
Applies to:
Backup4all 5.x - 8.x