This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Our beloved cron(8)
got very cool extensions! A ~
shortcut was added to let cron(8)
pick a random (consistent) timer value. This is useful when you want to run something once an hour but don't care when exactly. Another extension is the -s
option which helps prevent overlapping process launches when you have (unexpectedly) long-running processes.
The below example shows the power of this utility. I want rpki-client
to run once an hour, but not start if its still running from the previous hour. The 24
minute comes from the ~
operator. If I'd restart the cron(8)
daemon a new value will be picked.
This is very exciting!
job@anton ~$ doas crontab -l | grep rpki-client
~ * * * * -n -s rpki-client -v
job@anton ~$ doas grep rpki-client /var/cron/log | tail -3
Apr 17 14:24:01 anton cron[76532]: (root) CMD (rpki-client -v)
Apr 17 15:24:01 anton cron[59536]: (root) CMD (rpki-client -v)
Apr 17 16:24:01 anton cron[97530]: (root) CMD (rpki-client -v)
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/openbsd/com...