Logic Machine Forum
Scheduled Script - Feb 31st - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Scheduled Script - Feb 31st (/showthread.php?tid=3892)



Scheduled Script - Feb 31st - avolle - 21.02.2022

Hi,

Sometimes I create scripts that should never be run automatically. This is usually for testing or convenience. I usually make these as scheduled scripts, so I can press "Run script" to execute the code.

As a scheduled script normally should be run automatically, you still need to fill in the cron format as to when the script should execute. Usually I just fill inn "* * 31 2 1", so that it should never execute automatically. This is February 31st, which will never occur.

I did however notice that the script is being executed automatically today. Is this expected behavior or is this a bug in your cronjob handling?

See the attached images. For now, I'll just have to disable the scripts, which is fine.

Edit: This bug occurred in another site I have such a script enabled. That was a lightshow script for floodlights at a football stadium. Every Monday the customer complained that the lights turned on a midnight and stayed on. I didn't connect this until now. So it seems the bug is that the script runs every Monday of February.

It might be in the spec of cronjobs, that when it runs into an invalid date, it runs on every occasion instead.


RE: Scheduled Script - Feb 31st - admin - 21.02.2022

This is by design: if either the month or day of month is specified as an element or list, and the day of week is also specified as an element or list, then any day matching either the month and day of month, or the day of week, shall be matched


RE: Scheduled Script - Feb 31st - avolle - 21.02.2022

(21.02.2022, 16:36)admin Wrote: This is by design: if either the month or day of month is specified as an element or list, and the day of week is also specified as an element or list, then any day matching either the month and day of month, or the day of week, shall be matched

Ah, I see now. So, to avoid this I'll have to specify every weekday to avoid it being run automatically. Images fromĀ https://crontab.guru