# Script schedule

**URL:** <https://forum.inductiveautomation.com/t/script-schedule/97575>\
**Category:** Maker\
**Tags:** scripting\
**Created:** [October 21, 2024, 10:41pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575 "2024-10-21T22:41:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esme\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Esme\_Lopez](https://forum.inductiveautomation.com/u/Esme_Lopez)\
**Post date:** [October 21, 2024, 10:41pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/1 "2024-10-21T22:41:35Z")

</div>

Good afternoon!

I am working with an script schedule but is not executing, I thought was the version but is not.

I tried to search an example but I don't get it.

I mean if a create an example of script schedule, I should call the method ?

Thanks everyone

---

<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:** [October 21, 2024, 10:44pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/2 "2024-10-21T22:44:25Z")

</div>

What makes you think it's not working/can you show exactly what you've configured? Post both your code as text in a preformatted text block, and a screenshot of how you've got things configured.

---

<div class="post-metadata">

**Author:** ![Esme\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Esme\_Lopez](https://forum.inductiveautomation.com/u/Esme_Lopez)\
**Post date:** [October 21, 2024, 10:50pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/3 "2024-10-21T22:50:09Z")

</div>

Configuration:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/963e5e151e93f963bcde387b2585a1b315ab3709.png)

Script:

```python
def onScheduledEvent():

    Findate=system.date.now()
	month = system.date.getMonth(Findate) + 1
	year = system.date.getYear(Findate)
    print (month)

```

ABout gateway scripts is never executed

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/11ab63a57125b6b98ba5ac50c36b73aa3790c4e5.png)

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [October 21, 2024, 10:57pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/4 "2024-10-21T22:57:08Z")

</div>

- Is the project itself enabled?
  - Gateway scripts won't run if their project is disabled.

- Is the project inheritable?
  - Gateway scripts in an inheritable project are generally a bad idea, and they won't run unless there's at least one inheriting project.

---

<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:** [October 21, 2024, 11:08pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/5 "2024-10-21T23:08:13Z")

</div>

> [@Esme\_Lopez](#):
>
> ```python
> def onScheduledEvent():
> 
> Findate=system.date.now()
> month = system.date.getMonth(Findate) + 1
> year = system.date.getYear(Findate)
> print (month)
> 
> ```

If that's your exact code, you're mixing up tabs and spaces, which is never a good idea:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4dd3fac82851462a1b766071e85def4a20977567.png)

I'll also ask the obvious question: has 2:30 AM happened yet?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 21, 2024, 11:21pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/6 "2024-10-21T23:21:39Z")

</div>

> [@paul-griffith](#):
>
> has 2:30 AM happened yet?

And if it has, did you look in the **wrapper.log** text file? (That's the only place a `print` in gateway scope goes.)

---

<div class="post-metadata">

**Author:** ![Esme\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Esme\_Lopez](https://forum.inductiveautomation.com/u/Esme_Lopez)\
**Post date:** [October 21, 2024, 11:44pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/7 "2024-10-21T23:44:56Z")

</div>

Am I need to enable this right?:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/4/046612af8ebeddce182489466db70b4df4fd09cb.png)

---

<div class="post-metadata">

**Author:** ![Esme\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Esme\_Lopez](https://forum.inductiveautomation.com/u/Esme_Lopez)\
**Post date:** [October 21, 2024, 11:47pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/8 "2024-10-21T23:47:53Z")

</div>

I am using a docker container , Can I still have the acces to this archive ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 21, 2024, 11:50pm UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/9 "2024-10-21T23:50:19Z")

</div>

You would need to open a shell into the container. `docker exec` IIRC. (I haven't been using docker much, lately.)

Consider using a logger instead of using `print`.

Also, inheritable projects do not actually run anything. Only leaf projects are actually runnable. (You should never define gateway or Vision client events in inheritable projects--unless you **want** madness and confusion.)

---

<div class="post-metadata">

**Author:** ![Esme\_Lopez](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@Esme\_Lopez](https://forum.inductiveautomation.com/u/Esme_Lopez)\
**Post date:** [October 22, 2024, 12:06am UTC](https://forum.inductiveautomation.com/t/script-schedule/97575/10 "2024-10-22T00:06:45Z")

</div>

I will change it by the next some minutes
