# Crontab - fire every 5 seconds?

**URL:** https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157
**Category:** General
**Created:** [25 September 2025 02:05 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157 "2025-09-25T02:05:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [25 September 2025 02:05 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157/1 "2025-09-25T02:05:47Z")

</div>

Guys,

I want to fire a job every 5 seconds on the minute - i.e. 1:01 am + 5 Sec etc - not just 5 seconds after it first starts (get data from my Inverter) - i figured this would be easy with crontab but alas can not seem to find it.

Any ideas or alternate trigger nodes

I only want this to fire after sunrise and finish at sunset - but i figure i will use the within-time node to direct that

Craig

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [25 September 2025 05:21 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157/2 "2025-09-25T05:21:49Z")

</div>

You could use the cron-plus node + a time-range-switch node.

Cron expression: `*/5 * * * * *` (does not work in 'normal' linux cron, but should work with the cron-plus node)

This will fire every 5 seconds on the minute and you could pass it on a time-range-switch that can check if it is between sunrise/set.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [25 September 2025 07:11 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157/3 "2025-09-25T07:11:12Z")

</div>

Or fire on every minute then a 5 second delay 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: [25 September 2025 08:44 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157/4 "2025-09-25T08:44:51Z")

</div>

> [@craigcurtin](#):
>
> I want to fire a job every 5 seconds on the minute - i.e. 1:01 am + 5 Sec etc - not just 5 seconds after it first starts (get data from my Inverter) - i figured this would be easy with crontab but alas can not seem to find it.

Do you mean every 5 secs past a minute (e.g. `00:00:05`, `00:01:05`, `00:02:05`, ...)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9b980d9af7766e37e63558a5ddc1ae445cb1f92b.png)

Or do you mean every 5s every minute (on the 5s mark) (e.g. `00:00:00`, `00:00:05`, `00:00:10`, ...)

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

Or do you mean 5s past the minute and every 5 of that minute (e.g. `00:00:05`, `00:00:10` --\> `00:00:55`, `00:01:05`, `00:01:10`, ...)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/e/de8fcb94c35a2275525a2a7483688b28145cf33d.png)

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [25 September 2025 21:36 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157/5 "2025-09-25T21:36:22Z")

</div>

> [@Steve-Mcl](#):
>
> Or do you mean 5s past the minute and every 5 of that minute (e.g. `00:00:05`, `00:00:10` --\> `00:00:55`, `00:01:05`, `00:01:10`, ...)

Yep so we hit 5 seconds past midnight and i want it to start and then keep firing every 5 seconds (forever)

I can then use other nodes to filter that as to between what hours (Sunrise and Sunset) i want it to actually make the modbus call

Thanks for the examples looks like it will do exactly what i want.

regards

Craig

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 October 2025 21:36 UTC](https://discourse.nodered.org/t/crontab-fire-every-5-seconds/99157/6 "2025-10-09T21:36:27Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
