Reputation: 31
Can we get the status of an autosys job for the past 20 days. not the -r
command which given that particular day. the whole 20 days.
Upvotes: 2
Views: 39475
Reputation: 1085
I give you AUTOHIST.cmd Slow as heck but works from command line.
@echo off
SET JOB_NAME=%~1
IF [%JOB_NAME%]==[] GOTO Usage
SET NUM_ENTRIES=%~2
IF [%NUM_ENTRIES%]==[] SET NUM_ENTRIES=10
SET /A NUM_ENTRIES=%NUM_ENTRIES%-1
SET HIST_START=%~3
IF [%HIST_START%]==[] SET HIST_START=0
SET SKIP_HEADER=0
FOR /L %%R IN (%HIST_START%, 1, %NUM_ENTRIES%) DO (
CALL :HistoricalAutoRep %%R
)
GOTO :EOF
:HistoricalAutoRep
IF [%SKIP_HEADER%]==[0] (
SET OPTIONS="delims="
) ELSE (
SET OPTIONS="skip=3 delims="
)
FOR /F %OPTIONS% %%F IN ('CALL AUTOREP -J %JOB_NAME% -r -%1') DO ECHO %%F
SET SKIP_HEADER=1
GOTO :EOF
:Usage
ECHO AUTOHIST ^<Required job name^> [Optional number of historic runs to return] [Optional number of runs back to start querying history]
GOTO :EOF
Upvotes: 0
Reputation: 163
I think -r can give you what you want. Try executing below:
autorep –j <your job name> -r -19
Upvotes: 4