kanshi-rs

Crates.iokanshi-rs
lib.rskanshi-rs
version0.1.0
sourcesrc
created_at2022-09-28 07:34:07.176325
updated_at2022-09-28 07:34:07.176325
descriptionkanshi is a simple tool like Monit for monitoring file timestamp.
homepage
repositoryhttps://github.com/tatatakky/kanshi-rs
max_upload_size
id675482
size7,704
Kodai Takihara (tatatakky)

documentation

README

kanshi

kanshi is a simple tool like Monit for monitoring file timestamp.

why kanshi ?

Japanese kanshi(監視) means monit.

Usage

use kanshi::kanshi::Kanshi;
use kanshi::script;
fn main() {
    let kanshi = Kanshi::new("/your/target/monitored/file.pid");
    kanshi.every(3).lazy_exec(|| script("/your/execution/command"));
}

And then, you can get log in /var/log/kanshi.log like following

$ tail -f /var/log/kanshi.log
Wed Sep 28 15:23:50 2022 Kanshi[INFO] Start to do monitoring File Timestamp!
Wed Sep 28 15:27:37 2022 Kanshi[INFO] File Timestamp is changed now, then execute script!
Commit count: 5

cargo fmt