Shell
You're viewing a free preview. Sign in free to read every script.
Why this exists Scripts that run from cron or Jenkins run when nobody is watching. Three habits make them trustworthy: a log that says what happened, a lock so two runs do not collide, and idempotency so running twice…
Logging, Lock Files and Idempotent Scripts
Timestamped logging to screen and file, preventing two copies of a job running at once with flock, and writing scripts that are safe to run twice: check before acting, and prefer operations that are naturally repeatable.
Sign in free to read this script, along with the rest of the library.
Sign in free