# Scheduling script execution?

**URL:** <https://forum.inductiveautomation.com/t/scheduling-script-execution/49512>\
**Category:** Module Development\
**Tags:** ignition80, scripting\
**Created:** [August 3, 2021, 3:16pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512 "2021-08-03T15:16:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![son122](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@son122](https://forum.inductiveautomation.com/u/son122)\
**Post date:** [August 3, 2021, 3:16pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512/1 "2021-08-03T15:16:36Z")

</div>

Is it possible to execute a script on a schedule using the module SDK library?  
Similar to how the Ignition reports works.

I see SelfSchedulingRunnable a good starting point, but how would it be setup to run on the Gateway Hook?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [August 3, 2021, 3:26pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512/2 "2021-08-03T15:26:51Z")

</div>

Do you really need to schedule a script in your module? If you’re running Ignition 8.1.6 or later you can use [scheduled scripts](https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts#GatewayEventScripts-GatewayScheduledScripts) instead.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 3, 2021, 3:39pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512/3 "2021-08-03T15:39:38Z")

</div>

And if you do genuinely need to _schedule_ your own custom runnable, you could always create your own cron4j instance. `SelfSchedulingRunnable` works to set your own time delay between executions, but isn’t as user friendly as specifically setting an event to fire ‘every monday at 8AM’ or something like that.

---

<div class="post-metadata">

**Author:** ![son122](https://avatars.discourse-cdn.com/v4/letter/s/3be4f8/32.png) [@son122](https://forum.inductiveautomation.com/u/son122)\
**Post date:** [August 3, 2021, 3:48pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512/4 "2021-08-03T15:48:00Z")

</div>

Ah, OK thanks.  
I’ll look into cron4j/quartz.

---

<div class="post-metadata">

**Author:** ![DSandy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dsandy/32/29409_2.png) [@DSandy](https://forum.inductiveautomation.com/u/DSandy)\
**Post date:** [June 23, 2022, 8:39pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512/5 "2022-06-23T20:39:01Z")

</div>

Not wanting to open a new thread on the same/similar topic.

Is there any way to have the user interact with a gateway scheduled script. In particular, to change the schedule on which it runs? Otherwise I need to look at the cron4j as discussed here.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 23, 2022, 9:40pm UTC](https://forum.inductiveautomation.com/t/scheduling-script-execution/49512/6 "2022-06-23T21:40:14Z")

</div>

No, there’s no way to manipulate a scheduled script to run at a different execution schedule.
