I have a main autosys box (first_start_main_job)that has 2 different sub box.

When I enter autorep -j first_start_main_job -d I get something like:

JOb Name | Last Start | Last Run | ST | RUN | Pri/Xtx
first_start_main_job | some_time | some_time | SU | some_text
first_start_sub_job | some_time | some_time | SU | some_text
second_start_sub_job | some_time | some_time | SU | some_text

I just want ST(status) of first_start_main_job and store that in a variable.

Please let me know how to accomplish this.

Thanks in advance..

有帮助吗?

解决方案

Use the print level switch -L, with level 0, (zero) to list only the outermost box. Then use your favorite script tool to get and store the ST value.

For example:

autorep -J main_job_box -d -L0

man autorep from a AutoSys command prompt will give you more information if you need it.

其他提示

Just adding up to above posted answer. To get the Status of Job in a variable we can filter out the status using awk. e.g.

autorep -J first_start_main_job -d -L0 | awk '/SU /{print $6}'

It will check for the first line and if it contains "SU ", than the status will be printed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top