Logic Machine Forum
Scheduled scripts - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2)
+--- Thread: Scheduled scripts (/showthread.php?tid=2442)



Scheduled scripts - gtsamis - 28.01.2020

Hi,


I am trying to reset some energy metering registers and keep daily, weekly, monthly and yearly data.
Yearly script should run on 1st of Jan every year, monthly on 1st of every month exept of 1st of Jan, weekly every Monday between day 2-31 and daily every day between 2-31 except Mondays
I have created the scheduled scripts but noticed that they run daily and weekly (havent checked monthly and yearly yet). I know I could just create a single script and run different actions for each occasion but i'm curious what is wrong with my shedules.

Thank you in advance
George


RE: Scheduled scripts - Daniel - 28.01.2020

Hi
Which script is not running as you want? All together will run every day.
Add some logs to scripts to know which did run and which didn't
BR


RE: Scheduled scripts - gtsamis - 28.01.2020

(28.01.2020, 08:37)Daniel. Wrote: Hi
Which script is not running as you want? All together will run every day.
Add some logs to scripts to know which did run and which didn't
BR

The problem is that daily and weekly run every day... so far, havent checked monthly and yearly. What i would like to do is to run only one script each day according to logic on the 1st post

Quote:Yearly script should run on 1st of Jan every year, monthly on 1st of every month exept of 1st of Jan, weekly every Monday between day 2-31 and daily every day between 2-31 except Mondays



RE: Scheduled scripts - Daniel - 28.01.2020

Do you have that in logs that weekly runs on other days than Monday?


RE: Scheduled scripts - gtsamis - 28.01.2020

(28.01.2020, 09:03)Daniel. Wrote: Do you have that in logs that weekly runs on other days than Monday?

You will see that both daily and weekly ran every day  (the last 2 logs are because i disabled/reenabled them and changed the run time to check)


RE: Scheduled scripts - Daniel - 28.01.2020

which firmware?


RE: Scheduled scripts - gtsamis - 28.01.2020

(28.01.2020, 09:16)Daniel. Wrote: which firmware?
20191015


RE: Scheduled scripts - admin - 28.01.2020

This is by design (cron system utility):
The day of a command's execution can be specified by two fields — day of month, and day of week. If both fields are restricted (i.e., aren't *), the command will be run when either field matches the current time.

So you should just use a single script and check date fields manually.


RE: Scheduled scripts - gtsamis - 28.01.2020

Good to know... Will go with one script

Thanks