NetXMS Support Forum

English Support => General Support => Topic started by: Millenium7 on November 29, 2019, 04:15:52 AM

Title: CRON schedule doesn't work?
Post by: Millenium7 on November 29, 2019, 04:15:52 AM
I've created a scheduled task to run a script. I set CRON schedule to 0 * * ? * * * as a test to run the script every minute, but it never runs

Is there something i'm doing wrong? Do I need to turn on CRON scheduling in server options or something?
No problem in the script as it runs fine with one time execution (sends me an email), but if I use CRON it doesn't run at all

NetXMS version is 3.0.2329

Edit: Tried creating a dummy node and adding the script as a polling method with a CRON schedule, that too does not work. Yet setting the polling interval to i.e. 60 seconds works fine. So it seems CRON is completely broken in my instance, or i'm doing something wrong that i'm just not seeing
Title: Re: CRON schedule doesn't work?
Post by: Tatjana Dubrovica on December 03, 2019, 04:31:57 PM
Cron tab to run script every minute should look like: * * * * *
We support cron expressions with only 5 parts: minutes, hours, day(month), month, day.
Also NetXMS does not support "?" symbol.
Title: Re: CRON schedule doesn't work?
Post by: Millenium7 on December 04, 2019, 10:18:54 AM
Would be nice to have that documented somewhere. I searched for ages, found zero mention of it. Infact I found a few posts on these forums pointing to 'CRON generators' including the one that generated that
I'll test it out tomorrow

Edit: Yes using only 5 characters in the CRON schedule works as intended. Thank You. Just wish there was some information in the manual/guides or at least a little ? symbol in Schedule area's that when mousing over says something like "CRON format: [minute] [hour] [day of month] [month] [day] i.e. 5 3 * * * will run at 3:05am every day"