semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Question: What kind of cron flavor is used?

Open kris9854 opened this issue 9 months ago • 5 comments

Question

Any one know what kind of cron implementation is used by semaphore UI?

Want to schedule somehting for tue if it falls between the 15-21 at 12 o clock.

Image

I know that if it is utc time i need to say at 0 10. But it kinda weird that 0 12 15-21 * 2 doesn't work. Also tried using the timer format:

Tue *-*-15..21 12:00:00


Related to

Service (scheduled tasks, alerts)

kris9854 avatar May 02 '25 13:05 kris9854

Hi @kris9854 Package https://github.com/robfig/cron used for Schedules on backend and https://www.npmjs.com/package/cron-parser for frontend.

fiftin avatar May 02 '25 18:05 fiftin

@fiftin thanks. Soo i can't do it like i want :/ Do you maybe have an idear on how to go around it? Wrapper bash script that just calls a integration to start the template job?

Want to schedule a playbook to run on the 3th of tuesday in every month :)

kris9854 avatar May 04 '25 19:05 kris9854

Hi @kris9854

  1. robfig/cron understands this expression 0 12 15-21 * 2, so it should works. I will try to reproduce the issue.

  2. I will remove npm package cron-parser and add API endpoint to calculate next run time on backend.

fiftin avatar May 04 '25 20:05 fiftin

@fiftin is there any update on this :) Asking because I want to leverage cron to do some scheduled tasks :)

kris9854 avatar May 09 '25 07:05 kris9854

I'm curious about this as well, scheduling tasks is important to us.

Arceopteryx avatar Jun 10 '25 11:06 Arceopteryx

Hi @kris9854 I'm so sorry for delay.

I debugging the issue and I found only UI bug. Cron record 0 12 15-21 * 2 works as expected.

fiftin avatar Jul 20 '25 04:07 fiftin

@kris9854 I have checked two libraries, and they behave similarly: the day of month and day of week fields are combined using OR, not AND.

fiftin avatar Jul 20 '25 08:07 fiftin

I improved UI: Image

fiftin avatar Jul 20 '25 08:07 fiftin

I convert this issue to discussion because it is useful question but not a bug.

fiftin avatar Jul 20 '25 09:07 fiftin