# Scheduling monthly tasks

**URL:** <https://discourse.nodered.org/t/scheduling-monthly-tasks/13959>\
**Category:** General\
**Created:** [3 August 2019 09:19 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959 "2019-08-03T09:19:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![biz](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@biz](https://discourse.nodered.org/u/biz)\
**Post date:** [3 August 2019 09:19 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/1 "2019-08-03T09:19:40Z")

</div>

So I have a problem scheduling items.  
There are two mains nodes I have found to do 99% of my scheduling Bigtimer and schedx. Both are great. HOWEVER these are more for daily/weekly tasks. Is there any node out there that does monthly?  
For example I want to run an even on the last day of the month, or the first day of the month?  
Big timer is the closest it comes because you can include special days but still doesn't work 100% on 1st of the month or last day of the month.  
The inject node as well does some of my scheduling but it only can do up to a week  
Any suggestions on a node?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 August 2019 09:29 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/2 "2019-08-03T09:29:56Z")

</div>

> **[node-red-contrib-cron-plus](https://flows.nodered.org/node/node-red-contrib-cron-plus)**
>
> A flexible scheduler (cron, solar events, fixed dates) node for Node-RED with full dynamic control and time zone support

> [@biz](#):
>
> For example I want to run an even on the last day of the month

Yep - `0 0 12 L * * ` At 12:00 PM, on the last of the month

> [@biz](#):
>
> or the first day of the month

Yep - `0 0 12 1 * * ` At 12:00 PM, on the 1st day of the month`

Some more examples...

- `* * * * * *` Every Second
- `0 * * * * *` Every minute
- `0 */10 * * * *` Every 10 minutes
- `0 */20 1 * * *` Every 20 minutes, between 01:00 AM and 01:59 AM
- `0 15,30,45 * * * *` At 15, 30, and 45 minutes past the hour
- `0 0 12 * * *` Every day at noon - 12pm
- `0 0 2 29 FEB * 2020-2040` At 02:00 AM, on day 29 of the month, only in February, every 4 years, 2020 through 2040
- `0 0 7 * * MON#1 *` At 07:00 AM, on the first Monday of the month
- `0 0 12 * JAN,FEB,MAR,APR *` Every day at noon in January, February, March and April
- `* * 1W * *` Every minute, on the first weekday of the month
- `* * * * Tue#3` Every minute, on the third Tuesday of the month
- `0 12 * * MONL` At 12:00 PM, on the last Monday of the month

Below is the discussion thread with screen shots etc (scroll to end of thread for latest info)...

> [@UPDATE: V1.2.1 node-red-contrib-cron-plus scheduler (incl solar events and Timezone support)](https://discourse.nodered.org/t/release-v0-2-1-a-flexible-multiple-scheduler-node-incl-timezone-support-node-red-contrib-cron-plus/13686):
>
> Hi all, something I am working on. Would appreciate feedback/suggestions/criticisms please. Features... Timezone support human readable descriptions of cron Supports standard CRON + year Some pictures for now (details later). Help tab... In action... In action... Timezone... [image] Timezone... [image]

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [3 August 2019 09:38 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/3 "2019-08-03T09:38:52Z")

</div>

Sample flow and screen shots...

```auto
[{"id":"b1d41651.702f28","type":"cronplus","z":"ac2abaf3.ee3148","name":"","outputField":"payload","timeZone":"","options":[{"topic":"SOM","payload":"","type":"str","expression":"0 0 12 1 * * "},{"topic":"EOM","payload":"","type":"str","expression":"0 0 12 L * * "}],"x":940,"y":320,"wires":[["4bc38690.77e528"]]},{"id":"4bc38690.77e528","type":"switch","z":"ac2abaf3.ee3148","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"SOM","vt":"str"},{"t":"eq","v":"EOM","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1070,"y":320,"wires":[["d1b1fd22.3e658"],["2ec10a7f.8fee76"]],"outputLabels":["Schedule Trigger","Control Reply"]},{"id":"d1b1fd22.3e658","type":"debug","z":"ac2abaf3.ee3148","name":"Start of month","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1220,"y":260,"wires":[]},{"id":"2ec10a7f.8fee76","type":"debug","z":"ac2abaf3.ee3148","name":"End of month","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1210,"y":360,"wires":[]}]

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0dc354203d4840a14b64d61c9b443227c8a4d24d.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c962a845e24e1a8285f95bb501c6f6f51102e5b5.png)

---

<div class="post-metadata">

**Author:** ![biz](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@biz](https://discourse.nodered.org/u/biz)\
**Post date:** [3 August 2019 12:59 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/4 "2019-08-03T12:59:37Z")

</div>

Thanks for this, I didn't even think about cron jobs!  
Great job. I have used Cron jobs for standard linux stuff but not for node red  
this will be perfect 🙂

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [16 May 2021 10:43 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/5 "2021-05-16T10:43:05Z")

</div>

Thanks for this great tool. I am writing every frist day of the month some data to a database. I notice however that every time I deploy node red a trigger is sent. So if I am working on another flow I get a lot of unwanted database entries every time I deploy node red.

Is there a fix for this?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 May 2021 11:04 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/6 "2021-05-16T11:04:50Z")

</div>

It is impossible to answer that unless you tell us what mechanism you are using to trigger the write each month.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [16 May 2021 11:21 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/7 "2021-05-16T11:21:30Z")

</div>

Try only deploying updated nodes and not all nodes.

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [16 May 2021 11:42 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/8 "2021-05-16T11:42:04Z")

</div>

This is it:  
 ![afbeelding](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0afdae2d8c0ae37b4526bacf4e2d202a27a08070.png)

The cronplus node triggers the HS4 device and that data is prepared for and sent to the database.

I hope this is clear?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [16 May 2021 13:02 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/9 "2021-05-16T13:02:37Z")

</div>

> [@cope](#):
>
> The cronplus node triggers the HS4 device and that data is prepared for and sent to the database.

The cronplus node does not fire until its allotted time. I suspect that "Cumulatief mm" node is the culprit.  
To prove this, add a debug node (set to send to " system console") to the output of the cronplus node AND another to the output of the "Cumulatief mm" node - then deploy again. Be sure to set the `name` of both debug nodes. Then check your console and debug panel.

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [16 May 2021 13:17 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/10 "2021-05-16T13:17:42Z")

</div>

You are right, the "Cumulatief mm" node was the culprit. It is working fine now.  
Thanks for commenting.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 May 2021 13:25 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/11 "2021-05-16T13:25:36Z")

</div>

In addition, if, as suggested by @E1cid, you click the dropdown arrow on the Deploy button, and select Modified Nodes then a Deploy will only deploy modified nodes rather than all nodes, assuming that is what you currently have.

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [16 May 2021 13:36 UTC](https://discourse.nodered.org/t/scheduling-monthly-tasks/13959/12 "2021-05-16T13:36:15Z")

</div>

thanks for the hint!
