Crontab - a quick glance

DevOps Apr 30, 2021

crontab is a powerful tool for automation. One of the most common usage nowadays is certification renewal, no matter using certbot or acme.sh.

Edit task

Edit crontab for current user

crontab -e

Edit crontab for root user

sudo crontab -e

Edit crontab for specific user

crontab -u <username> -e

List task

crontab -l is used for this purpose

Test crontab rules

Crontab.guru could be used for this purpose, which provides a nice visualised interface for either beginners or advanced users.

Crontab.guru - The cron schedule expression editor
An easy to use editor for crontab schedules.

The following examples can also be used for quick reference

Cron examples - Crontab.guru

Check if tasks executed correctly

grep -i cron /var/log/syslog

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.