0

I looking for a way to convert integer that represente a minute count to a cron time

var totalMinute = 1300 to an acceptable cron time : */* * * * *

(The cron will execute every 1300 minutes)

I tried to convert to Date then to cron, but i'am stuck

Thanks for your help!

Romeh
  • 29
  • 8
  • Can you elaborate as to how you got from `1500` to `*/* * * * *`? I'm not certain that's even a valid `cron` schedule expression, at least in any flavor of `cron` I'm aware of. – esqew Oct 20 '22 at 14:21
  • That the point... i am looking to convert 1500 to a crone time that represent an execution of the task every 1500 minutes – Romeh Oct 20 '22 at 14:23
  • For exemple : `*/1 * * * *` represente a cron execution every minute. but i can't use `*/1500 * * * *` . I need to make a proper convertion – Romeh Oct 20 '22 at 14:24
  • Does this answer your question? [Cronjob every 25 hours?](https://stackoverflow.com/questions/1417098/cronjob-every-25-hours) – esqew Oct 20 '22 at 14:25
  • not really, but thanks :/ – Romeh Oct 20 '22 at 14:27
  • I edited my question, I firstly wirtten 1500 (now its 1300) minute, because Iam not planning to run more than 24h , wrong explanation sorry! I hope that my question is more precise now – Romeh Oct 20 '22 at 14:31
  • That's not possible with a single cron expression, because the semantics of a cron expression is one (or multiple) timestamps and not durations. And 1300 is not a duration that can be mapped to set of timestamps during the day. Furthermore, you would need to define an inital timestamp, when the 1300 minutes would start ... – derpirscher Oct 20 '22 at 15:34

0 Answers0