kota's memex

A small, but flexible alternative to cron, which essentially just waits for a particular time, and then executes a command. To get recurring jobs ala cron, we can use this together with our runit service supervision suite. If we wanted at(1) instead, we can just run snooze once.

rosetta

run five minutes after midnight, every day: cron: `5 0 * * *` snooze: `-M5`
run at 2:15pm on the first of every month: cron: `15 14 1 * *` snooze: `-d1 -H14 -M15`
run at 10 pm on weekdays: cron: `0 22 * * 1-5` snooze: `-w1-5 -H22`
run 23 minutes after midnight, 2am, 4am ..., everyday: cron: `23 0-23/2 * * *` snooze: `-H/2 -M23`
run every second week: snooze: `-W/2`
run every 10 days: snooze: `-D/10`

The -n option disables the actual execution and shows the next five matching times instead.

To run every 15 minutes:

$ snooze -n -H'*' -M/15
2017-12-24T16:15:00+0100 Sun  0d  0h  1m 31s
2017-12-24T16:30:00+0100 Sun  0d  0h 16m 31s
2017-12-24T16:45:00+0100 Sun  0d  0h 31m 31s
2017-12-24T17:00:00+0100 Sun  0d  0h 46m 31s
2017-12-24T17:15:00+0100 Sun  0d  1h  1m 31s