BusyBox crond format help
I'm seeking documentation on the format that BusyBox's crond supports under BB 1.35.0. I could not find anything, so I took to reading source, but quickly got confused and started to not believe what I was reading. Originally, I was hoping to find that crond supported "H" (the random value in cron). As I began reading crond.c, I started to think that it didn't even support ranges like 1-10. I base this off of lines 234 and 270 where skip is set to 0 and if the field is not *, a digit, or one of the pre-defined 3-character strings, it seems to throw a parsing error even though comments seem to imply that it handles an optional range. https://git.busybox.net/busybox/tree/miscutils/crond.c?h=1_35_stable#n234 So, maybe less about the interpretation of the C code and more about documentation on the scheduling formats BB crond supports. Thank you, *John Greg Hossbach* VCP6.5-DCV, VCP6-DCV Sr. Engineer, DevOps @ Tail Light ¦ https://calendly.com/john-hossbach ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: BusyBox crond format help
> Originally, I was hoping to find that crond supported "H" (the random value > in cron). It looks like 'H' token for random/hashed time is a special extension and only supported in Jenkins cron by far: https://www.jenkins.io/doc/book/pipeline/syntax/#cron-syntax https://github.com/jenkinsci/jenkins/commit/a31a186b https://issues.jenkins.io/browse/JENKINS-17311 https://en.wikipedia.org/wiki/Cron#Non-standard_characters After poking around man pages and source code, busybox cron and other alternatives looks like do not support 'H' yet: Vixie cron: https://man7.org/linux/man-pages/man5/crontab.5.html cronie: https://linux.die.net/man/5/crontab GNU mcron: https://www.gnu.org/software/mcron/manual/mcron.html -- Regards, Jones Syue | 薛懷宗 QNAP Systems, Inc. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: BusyBox crond format help
Found a link has alternative examples might help, prepend a sleep with random intervals before starting a job: https://stackoverflow.com/questions/9049460/cron-jobs-and-random-times-within-given-hours -- Regards, Jones Syue | 薛懷宗 QNAP Systems, Inc. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox
Re: BusyBox crond format help
Thank you so much! Also finally remembered my C char * from being mothballed and now the code makes sense. ha. I like the idea of sleep random! On Fri, Jan 26, 2024, 1:34 AM Jones Syue 薛懷宗 wrote: > Found a link has alternative examples might help, > prepend a sleep with random intervals before starting a job: > > https://stackoverflow.com/questions/9049460/cron-jobs-and-random-times-within-given-hours > > -- > > Regards, > Jones Syue | 薛懷宗 > QNAP Systems, Inc. ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox