Reading crontab -l can be cumbersome and I needed a nicer formatted view of the next cron jobs. cronview takes the output from crontab -l and prints a list of desired length.
the script uses croniter
, which you can install with pip
pip install croniter
In linux, crontab -l prints the cron jobs for your user. Simply pipe the content from crontab -l into the script and specify how many occurences, ie.
crontab -l | python cronview.py 4
You can also show the cron agenda for a different user like this:
crontab -u username -l | python cronview.py 100
You can also show the cron agenda for a different cron file like this:
cat /etc/cron.d/yourcrontab | python cronview.py 100
You can also setup a cron job to automatically send you an email regularly with a list of the upcoming cron jobs. Require mailutils to be installed.
Write a bashscript such as
#!/bin/sh
crontab -l | python /path/to/cronview/cronview.py 10 | mailx -s "Next cronjobs on wonderland" emailaddress
Then, add it to PATH by for example making a symbolic link to it
sudo ln -s /usr/local/bin/crontab2email /path/to/bashscript.sh
Now, add a cron job using crontab -e
for example like this
0 7 * * 1 crontab2email
to send yourself an email every monday at 07:00
Suggestions, use the issue tracker or improve the script yourself. I'm happy for push requests.