1 stable release
|1.0.0||Jan 31, 2023|
#475 in Command line utilities
A flyweight tool for checking stampfile freshness.
Install from source with
$ cargo install stampiotic
You can build optimised binaries using Nightly's build-std feature, saving around 200 KiB.
$ cargo +nightly build --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu
Spinning up a shell (or worse, a Python or Perl script) takes substantially
longer than invoking a small binary, so why bother? Some containers might not
even include a shell by default.
stampiotic has exactly one dependency: libc.
stampiotic is a particularly useful tool for implementing a watchdog timer in
Kubernetes. Legacy services can just touch a stampfile periodically, which can
then be checked using
stampiotic as a periodic Kubernetes health check.
$ stampiotic max-age stampfile [...]
$ stampiotic 60s /run/foo/foo-server.stamp 60s $ stampiotic '30 min' make.stamp $ stampiotic 1d long-process-1.stamp long-process-2.stamp File "long-process-2.stamp" is too old (12345s > 86400s) $ echo $? 1
Durations are parsed by
||3600 s = 60 minutes|
||86,400 s = 24 hours|
||604,800 s = 7 days|
||30.44 days = 2630016 s|
||365.25 days = 31557600 s|