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 8/30/2011 to 00:00:00 8/31/2011
will show all jobs for the period from
16:00:00 8/29/2011 to 16:00:00 8/30/2011
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:
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 -C0998 -Iucybdbrt.trace.ini -R&today#&hour#00 -X/automic/utilities/bin/queries/pststats.s.xml -TCSV -
@if NOT %ERRORLEVEL% == 0 goto :retcode