我在一个盒子工作中有三个工作,并希望安排三个工作一个接一个地运行。 job1,job1成功时job2,job2成功时job3。我还想添加一个计时条件,让job2在job1成功后等待10分钟,类似于job3在job2成功后等待10分钟。目前我有这个:
job2:
condition: s(job1)
job3:
condition: s(job1) & s(job2)
我不知道如何添加10分钟延迟。 这样的事情会起作用吗?
condition: s(job1,00.10) & s(job2,00.10)
谢谢!
答案 0 :(得分:1)
不,在这种情况下,回顾是不合适的。 我会在job2和job3之间添加一个睡眠作业
答案 1 :(得分:0)
我使用文件观察器来实现这一目标。请参阅下面的“睡眠”30秒......
/* ----------------- T4useBJ_CHRIS_SLEEP_TEST ----------------- */
insert_job: T4useBJ_CHRIS_SLEEP_TEST job_type: BOX
owner: administrator
permission: gx,wx
date_conditions: 0
description: "Sleep test"
alarm_if_fail: 0
/* ----------------- T4useEXT_CHRIS_SLEEP_TEST ----------------- */
insert_job: T4useEXT_CHRIS_SLEEP_TEST job_type: CMD
box_name: T4useBJ_CHRIS_SLEEP_TEST
command: copy nul D\:\hrbatch\test\sleep_test.txt /* use touch on UNIX */
machine: trent4
owner: administrator
permission: gx,wx
date_conditions: 0
description: "Trigger File Watcher"
std_out_file: "d:\hrbatch\Test\%AUTO_JOB_NAME%.%AUTORUN%.out"
std_err_file: "d:\hrbatch\Test\%AUTO_JOB_NAME%.%AUTORUN%.err"
alarm_if_fail: 0
/* ----------------- T4useFW_CHRIS_SLEEP_TEST ----------------- */
insert_job: T4useFW_CHRIS_SLEEP_TEST job_type: FW
box_name: T4useBJ_CHRIS_SLEEP_TEST
machine: trent4
owner: administrator
permission: gx,wx
date_conditions: 0
condition: success(T4useEXT_CHRIS_SLEEP_TEST)
description: "Look for sleep_test.txt file"
alarm_if_fail: 0
watch_file: "d:\hrbatch\test\sleep_test.txt"
watch_interval: 30
/* ----------------- T4useDEL_CHRIS_SLEEP_TEST ----------------- */
insert_job: T4useDEL_CHRIS_SLEEP_TEST job_type: CMD
box_name: T4useBJ_CHRIS_SLEEP_TEST
command: del D\:\hrbatch\test\sleep_test.txt
machine: trent4
owner: administrator
permission: gx,wx
date_conditions: 0
condition: success(T4useFW_CHRIS_SLEEP_TEST)
description: "Remove trigger file"
std_out_file: "d:\hrbatch\Test\%AUTO_JOB_NAME%.%AUTORUN%.out"
std_err_file: "d:\hrbatch\Test\%AUTO_JOB_NAME%.%AUTORUN%.err"
alarm_if_fail: 0