#recurring #jobs #cron

recurring-tasks

Define tasks and run them in an app periodically, ala cronjobs. And don't run already/still running tasks.

8 stable releases

Uses new Rust 2024

2.1.0 Oct 30, 2025
2.0.1 Oct 30, 2025
1.3.0 Oct 19, 2025
1.2.0 Feb 8, 2025

#1141 in Asynchronous

MIT license

21KB
358 lines

recurring-tasks -- Recurring Tasks Manager

Rust crate to build an app that (simply) runs recurring, periodic tasks -- effectively cronjobs, in a dedicated process. And will not run a task that is already (still) running. Supports sub-second periods.

Full, but easily digestible, examples are in the apps dir.

This is designed to be a very focused solution for building an app that has only one job: running various tasks repeatedly, forever. Look at (not mine, just shoutout) tokio-cron-scheduler crate for a much more elaborate approach, using crontab syntax.

Very important: in WSL2, Rust's Instant does not properly track seconds for some reason, the virtual clock seems to be just a tiny bit slow relatively to the actual clock, so it will often accumulate 2-3 extra seconds on 20 sec periods... This crate uses Tokio, which is built on Instant, so this drift will be visible in WSL.

Docs.rs documentation.

Dependencies

~8–14MB
~159K SLoC