0

I have a scenario where I have to retry run the failed autosys command job after 10 minutes. I have to retry rerunning it only twice. I cannot use n_retry attribute here because I need to wait for 10 minutes for every failure of the command box.

What I have implemented is, after the command box I want to create, another cmd job that calls a batch script that sleeps for 10 minutes and this has to be done only twice, like first time when it fails it will call the sleep for 10 minutes and then again call the cmd job if it fails again, call sleep for 10 more minutes and then call the cmd job if it fails for a second time then come out of the loop.

Can there be a batch script that can set a counter as 2 and call sleep?

1
  • Did you perhaps misspell "job" in the question title? Can you show us the code you have so far? Please EDIT your question to fix these issues. Commented Jun 11 at 21:43

1 Answer 1

0

This script will run a specific command twice and waiting 10 minutes between each try:

@echo off

set Counter=0
:restart
cls
timeout /t 600

{your command here}

set /a Counter+=1
IF %Counter% LEQ 2 goto :restart
exit
2
  • See the tag: bash-script
    – Io-oI
    Commented Jun 18 at 1:58
  • Also in the condition that a first command/execution fails.. only in this condition: ...I have to retry run the failed autosys command job after 10 minutes...
    – Io-oI
    Commented Jun 18 at 2:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .