NCrontab icon indicating copy to clipboard operation
NCrontab copied to clipboard

Any Operator Support

Open elksson opened this issue 6 years ago • 4 comments

For some reason I cannot get this ? (Any Operator) to work.

Is there a way to create the following cron using NCronTab?

? ?/15 7-22 * * *

At ? seconds past the minute, every 15 minutes, starting at ? minutes past the hour, between 07:00 AM and 10:59 PM

elksson avatar May 02 '19 17:05 elksson

NCrontab doesn't claim to support ? in any of the fields of the expression (see Crontab Expression) so it's not surprising you can't get it to work.

atifaziz avatar May 03 '19 09:05 atifaziz

How would one start to add this support?

elksson avatar May 07 '19 13:05 elksson

How would one start to add this support?

I'm not sure at which level you're asking this. Do you mean how to add support to this project via a PR or are you looking for guidance at the code level in your own private fork?

Either way, there is no standard definition of ?. For example, the CRON expression section of the Wikipedia article on Cron says this:

Question mark (?)

In some implementations, used instead of '*' for leaving either day-of-month or day-of-week blank. Other cron implementations substitute "?" with the start-up time of the cron daemon, so that ? ? * * * * would be updated to 25 8 * * * * if cron started-up on 8:25am, and would run at this time every day until restarted again.

atifaziz avatar May 09 '19 07:05 atifaziz

I would like direction on how I would fork the project to add support so that ? would use the time the cron expression started. Then after I have implemented I would like to make a pull request to bring it back into the project.

elksson avatar Nov 16 '19 21:11 elksson