find seconds to next cronjob
3c887e23 — Martin Vahlensieck 2 years ago
Remove goroutine
Do not invoke crontab, read input from stdin instead. Recoded the awk trick in Go.
seed with a large number that pinephone can handle



You can also use your local clone with git send-email.


mnc (my next cron) opens the user's crontab and echos the time when the next cronjob will be ran.

This program is intended to run with rtcwake on mobile devices to determine when to wake up in time to run cron jobs.


go build mnc.go


Returns the number of seconds until the next cronjob is due, use with crontab -l:

crontab -l | mnc

Mnc reads from stdin and supports only crontab-style input

#Use case

A construction like this is used in Sxmo to wakeup the system when the next cronjob is due:

sxmoscreenlock.sh rtc "$(crontab -l | mnc)"

In this use case, make sure you run this command via st on the phone rather than over ssh.

#Support and patches

Send support questions and patches to the mailing list: public inbox.

Please use git send-email and send a patch to my public inbox.