Anda di halaman 1dari 3

How to get a daily report with all backup executions http://www.backup4all.com/kb/how-to-get-a-daily-report-with-all-bac...

How to get a daily report with all backup executions


Mar 8, 2016

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 Export the logs matching the Event Viewer filter

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.

1. Go to Start->Control Panel->Administrative Tools->Event Viewer


2. Press the Filter current log button from the right side column.
3. On the Logged dropdown list, select Last 24 hours
4. For Event level select the levels you want. In this example we selected only warning and error
5. For Event sources select Backup4all 6 (for version 5 of Backup4all, please select Backup4all 5)

6. Press OK

7. Go to XML tab of the filter you created and copy the following part:

[System[Provider[@Name='Backup4all 6'] and (EventID=%EVENT_ID%) and


TimeCreated[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]"

For Backup4all 5, please use the following part:

[System[Provider[@Name='Backup4all 5'] and (EventID=%EVENT_ID%) and


TimeCreated[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]"

1 of 3 3/7/2017 9:20 PM
How to get a daily report with all backup executions http://www.backup4all.com/kb/how-to-get-a-daily-report-with-all-bac...

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.

For Backup4all 6:

::----------------------------------------------------------------

:: @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 6'] 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

::-------------------------------------------------------------

For Backup4all 5:

::----------------------------------------------------------------

:: @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 5'] 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

2 of 3 3/7/2017 9:20 PM
How to get a daily report with all backup executions http://www.backup4all.com/kb/how-to-get-a-daily-report-with-all-bac...

::-------------------------------------------------------------

The following line is from the Windows Event filter you created, you can find it on the xml tab. Replace it with your filter.

For Backup4all 6:

*[System[Provider[@Name='Backup4all 6'] and (EventID=%EVENT_ID%) and


TimeCreated[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]"

For Backup4all 5:

*[System[Provider[@Name='Backup4all 5'] and (EventID=%EVENT_ID%) and


TimeCreated[(@SystemTime>'%dtDay%T00:00:00') and (@SystemTime<'%dtDay%T23:59:59')] ]]"

Applies to:

Backup4all 5.x, 6.x

NEW: Backup4All 6.4.320

3 of 3 3/7/2017 9:20 PM

Anda mungkin juga menyukai