CronTab

A cron job library for Rust.

Usage

Please see the Documentation for more details.

Add to your Cargo.toml:

toml [dependencies] cron_tab = "0.1.1"

The cron expression format:

text sec min hour day of month month day of week year * * * * * * * Example:

```rust extern crate cron_tab;

use chrono::{FixedOffset, Local, TimeZone, Utc};

fn main() {
let localtz = Local::fromoffset(&FixedOffset::east(7));
let utc_tz = Utc;

let mut cron = crontab::Cron::new(utctz);

let jobtestid = cron.add_fn("* * * * * * *", test).unwrap();

cron.start();

std::thread::sleep(std::time::Duration::fromsecs(2));
let anonymous
jobid = cron
.add
fn("* * * * * *", || {
println!("anonymous fn");
})
.unwrap();

// remove jobtest
cron.remove(job
test_id);

std::thread::sleep(std::time::Duration::from_secs(2));
// stop cron
cron.stop();
}

fn test() {
println!("now: {}", Local::now().to_string());
} ```

License