Salome_Prangl-Groetzl_759

Reporting Tool in batch mode appears to report incorrect time frame

Discussion created by Salome_Prangl-Groetzl_759 on Dec 19, 2016
Detailed Description and Symptoms
When running the Reporting Tool in batch mode for statistics from a 24 hour period of time, the incorrect 24 hour period of time shows.  

For example, when in the Pacific timezone (GMT -8), a query for the time period from 

00:00:00 20/8/2016 to 00:00:00 21/8/2016 

will show all jobs for the period from 

16:00:00 19/8/2016 to 16:00:00 20/8/2016

Solution

The reason that this happens is that the Reporting Tool queries the database based on UTC time (as it is stored in the database) rather than the timezone specified within a client - the client timezone is only used for output of the reporting tool. In order to get the information for 24 hours based on the timezone specified in the client, the time based on UTC needs to be used with the -R parameter. In this case, in order to do this for all tasks run on 8/30/2011, the parameter would need to be:

Client 022

./ucybdbrt -C022 -Iucybdbrt.trace.ini -R&today#&hour#00 -X/automic/utilities/bin/queries/pststats.s.xml -TCSV -
@set retcode=%errorlevel%

To put this into Automic scripting to capture all tasks run yesterday in client 998, you would use the following:

:set &tdft# = 'YYYY-MM-DD'

:set &today# = SYS_DATE_PHYSICAL(&tdft#, UTC)

:set &todayutc# = CONV_TIMESTAMP('&today# 08:00:00')

:set &today# = conv_date('YYYY-MM-DD:&today#', 'YYYYMMDD')

:set &hour# = str_cut(&todayutc#, 12, 2)

./ucybdbrt -C022 -Iucybdbrt.trace.ini -R&today#&hour#00 -X/automic/utilities/bin/queries/pststats.s.xml -TCSV -
@set retcode=%errorlevel%

@if NOT %ERRORLEVEL% == 0 goto :retcode

Outcomes