This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Scheduled scripts
#1
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

Attached Files Thumbnail(s)
                   
Reply
#2
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
------------------------------
Ctrl+F5
Reply
#3
(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
Reply
#4
Do you have that in logs that weekly runs on other days than Monday?
------------------------------
Ctrl+F5
Reply
#5
(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)

Attached Files Thumbnail(s)
   
Reply
#6
which firmware?
------------------------------
Ctrl+F5
Reply
#7
(28.01.2020, 09:16)Daniel. Wrote: which firmware?
20191015
Reply
#8
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.
Reply
#9
Good to know... Will go with one script

Thanks
Reply


Forum Jump: