I never really liked cronjob expressions.
Show HN: Cronexpr, a Rust library to parse and iter crontab expression
11–20 of 36 posts
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#12I've LLM based crontab bot. Where I simply write stuff like "run my backupBitBuckettoDropbox.sh from home directory at 3am everyday". I never really liked cronjob expressions.
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#13I've LLM based crontab bot. Where I simply write stuff like "run my backupBitBuckettoDropbox.sh from home directory at 3am everyday". I never really liked cronjob expressions.
This sounds great, if i could trust it to get it right 100% of the time.
That should give you all the information you need to determine if it got the right expression.
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#14It also has a cron scheduler [0] which includes scheduling down to seconds and perfectly integrates with asyncio [1].
async def myfunc():
print(f"\n{Fore.GREEN}Readout triggered at { datetime.now().strftime('%H:%M:%S') }{COLORS_RESET}\n")
await disk_temperatures_handler.readout(storage)
scheduler = AsyncIOScheduler()
storage['scheduler'] = scheduler
scheduler.add_job(myfunc, CronTrigger(second='*/15'), id='readout_job')
scheduler.start()
You can also modify the interval on-the-fly.[0] https://apscheduler.readthedocs.io/en/3.x/modules/triggers/c...
[1] https://apscheduler.readthedocs.io/en/3.x/modules/executors/...
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#15Main drawback is the need for timestamps. Most crontab files or expressions I've seen didn't have them.
Could you elaborate a bit on the issue? I'm not sure you are commenting on cronexpr or other libraries. In cronexpr, there is no requirement for a timestamp until you'd like to find the next scheduled time, and thus you need to provide a related point. To decouple with certain datetime lib, I made a `MakeTimestamp` struct which provides multiple constructors. Later, I found it somehow like a function overload :D
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#16Main drawback is the need for timestamps. Most crontab files or expressions I've seen didn't have them.
If you mean timezone, I wrote an FAQ [1]: "Why does the crate require the timezone to be specified in the crontab expression?" [1] https://docs.rs/cronexpr/latest/cronexpr/#why-does-the-crate...
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#17Earlier quoted context omitted.
If you mean timezone, I wrote an FAQ [1]: "Why does the crate require the timezone to be specified in the crontab expression?" [1] https://docs.rs/cronexpr/latest/cronexpr/#why-does-the-crate...
Is `timezone` optional? I like it that it has the ability for one to provide it, but not providing it could just use the one the system has been configured to use.
1. Optional Timezone.
2. Second-level precision (perhaps feature flags are more suitable here)
It just falls out my first requirements so I don't support it. Being too generic is a common source of failure in my experience.
As a library developer I have my opinion on how things should be done and provide the default fits that mind :D
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#18Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#19After working with Jenkins which has "hashed value" support for automatic staggering of jobs, I think its essential in any cron syntax evaluater.
Re: Show HN: Cronexpr, a Rust library to parse and iter crontab expression
#20If you're into Python, APScheduler is the way to go. It also has a cron scheduler [0] which includes scheduling down to seconds and perfectly integrates with asyncio [1]. async def myfunc(): print(f"\n{Fore.GREEN}Readout triggered at { datetime.now().strftime('%H:%M:%S') }{COLORS_RESET}\n") await disk_temperatures_handler.readout(storage) scheduler = AsyncIOScheduler() storage['scheduler'] = scheduler scheduler.add_j…