nextcron.py

nextcron.py reads one or more crontabs from stdin and displays upcoming cronjobs which are about to run next. It is written in pure Python 3 and needs no additional modules.

Installation

  1. Put nextcron.py to e.g. your /usr/local/bin/ directory
  2. Make it executable: chmod 0755 /usr/local/bin/nextcron.py
  3. Optionally, edit nextcron.py and adjust the very first line to point to your Python executable.

Usage

From its built-in help (nextcron.py -h):

nextcron.py -- displays upcoming cronjobs

Usage:
  nextcron.py [<maxjobs>] [<isostart>] [+|-<startdelta>]
  nextcron.py [-h | --help]

Synopsis:
  crontab -l | nextcron.py [<parameters> ...]
  nextcron.py [<parameters> ...] < /etc/crontab
  cat /var/cron/tabs/* | nextcron.py [<parameters> ...]

Parameters:
  The order of parameters is irrelevant. You may add or omit them at your ease.

  <maxjobs>          Display just next <maxjobs> upcoming cronjobs; default: 20
  <isostart>         Display jobs starting at <isostart> and later instead of
                     now; valid examples of <isostart>:
                     2021-10-30 (Oct 30th, 2021)
                     2021-12-01 20:15 (quarter past 8 p.m. on Dec 1st, 2021)
                     2022-01-01 00:00:23 (23 seconds into 2022)
  +|-<startdelta>    When displaying jobs, add or substract
                     <startdelta> minutes to the start date and time, which
                     may be now or <isostart>; default: 0
  --version          Display version number
  -h, --help         Show this help ;-)

Releases