crontool
Paste a schedule, read it in English, see the next runs.

Add a Cron Job in /etc/cron.d

Files in /etc/cron.d let you drop in system cron jobs — ideal for packages and configuration management. The key difference from a user crontab: each line has an extra username field between the schedule and the command.

The file format

Create a file like /etc/cron.d/mytask with a user field after the five time fields:

*/5 * * * * www-data /usr/bin/php /var/www/app/task.php >> /var/log/task.log 2>&1

That runs every 5 minutes as www-data. A regular crontab -e line has no user field because it always runs as its owner.

Rules for the file

The filename must contain only letters, digits, underscores and hyphens (no dots) or cron ignores it. Set chmod 644 and owner root. End the file with a newline.

Set PATH at the top

Like any cron file, add PATH=/usr/bin:/bin and SHELL=/bin/bash lines above the jobs if commands aren't resolving.

When to use it

Use /etc/cron.d for jobs deployed by packages, Ansible, or that must run as a specific system user. Use crontab -e for personal, per-user jobs.

FAQ

What is the format of a /etc/cron.d file?

Five time fields, then a username, then the command: */5 * * * * www-data /usr/bin/php /path/task.php. The username field is what makes it different from crontab -e.

Why is my /etc/cron.d job not running?

Common causes: the filename contains a dot (cron ignores it), wrong permissions (use 644, owner root), a missing username field, or no trailing newline.

When should I use /etc/cron.d vs crontab -e?

Use /etc/cron.d for system/package jobs and jobs that must run as a specific user. Use crontab -e for personal per-user jobs.