# Executing a Job every x minutes/hours via Retry component

**URL:** <https://matillioncommunity.discourse.group/t/executing-a-job-every-x-minutes-hours-via-retry-component/1839>\
**Category:** Matillion ETL\
**Created:** [August 5, 2022, 4:07pm UTC](https://matillioncommunity.discourse.group/t/executing-a-job-every-x-minutes-hours-via-retry-component/1839 "2022-08-05T16:07:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aristotle](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Aristotle](https://matillioncommunity.discourse.group/u/Aristotle)\
**Post date:** [August 5, 2022, 4:07pm UTC](https://matillioncommunity.discourse.group/t/executing-a-job-every-x-minutes-hours-via-retry-component/1839/1 "2022-08-05T16:07:15Z")

</div>

I know that this issue has been discussed in the forum and there are some ideas and enhancement suggestions for it. In the meantime, I developed something that works but I am not sure if it's a really bad idea.

&nbsp;

I am trying to execute multiple jobs in sequence. The jobs belong to different projects. I would also like the 1st job to complete, before the next one starts. The solution that I found to execute a job from a different project is to call the proper Matillion API with project/job/version/name/environment from Bash. I capture the JSON that is being returned and retrieve the Execution ID.

&nbsp;

Subsequently, I check for the status of the job, until SUCCESS or FAILED is returned. I then loop (in Bash again) every 10 minutes - or whatever time is appropriate - and check again. The loop looks something like this:

&nbsp;

_for run in {1..10}; do_

_JOBSTATUS=$(curl -k -X GET -u user:pass_

_http://localhost:8080/rest/v1/task/id/$P\_JOBID -s | jq -r ".state")_

_if [$JOBSTATUS = 'SUCCESS' || $JOBSTATUS = 'FAILED'];_

_then_

_&nbsp;&nbsp;&nbsp;&nbsp; break_

_else_

_sleep 3600_

_fi_

_done_

_echo $JOBSTATUS_

&nbsp;

So, this job is basically running, possibly, for hours until it is ready to exit and execute the next job.

&nbsp;

My question is: does this put a tremendous load on the Matillion server? What if Matillion is running on a single processor? Will that basically slow down all other executions/jobs that might be running in parallel? And would implementing an enhanced Retry Component make a difference in the load to the Matillion server?

&nbsp;

Thank you,

Aristotle

&nbsp;

---

<div class="post-metadata">

**Author:** ![Life\_Long\_Learner](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/life_long_learner/32/57_2.png) [@Life\_Long\_Learner](https://matillioncommunity.discourse.group/u/Life_Long_Learner)\
**Post date:** [August 14, 2022, 7:28pm UTC](https://matillioncommunity.discourse.group/t/executing-a-job-every-x-minutes-hours-via-retry-component/1839/2 "2022-08-14T19:28:23Z")

</div>

Yes this issue was resolved in Matillion v 1.63 update.

Instead of using sleep and bash script you can do it directly in the GUI of the Retry component properties

&nbsp;

You just select CUSTOM in Retry delay.

Specify you retry interval, an time unit

&nbsp;

See below

&nbsp;

 ![0694G00000MZ6bhQAD_0D74G000006ctXpSAI](https://us1.discourse-cdn.com/flex002/uploads/matillioncommunity/original/1X/b998002bab30321c29d525b59b7e441b2735c0c5.jpeg)

---

<div class="post-metadata">

**Author:** ![Aristotle](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Aristotle](https://matillioncommunity.discourse.group/u/Aristotle)\
**Post date:** [August 14, 2022, 8:20pm UTC](https://matillioncommunity.discourse.group/t/executing-a-job-every-x-minutes-hours-via-retry-component/1839/3 "2022-08-14T20:20:57Z")

</div>

But there is no way to exit the Retry loop, is there?
