๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

๐Ÿ’ก Logging & Monitoring August 12, 2026 6

Linux Command: crontab

Schedule recurring tasks with cron

Terminal โ€” Logging & Monitoring
Command
$ crontab -e

crontab schedules recurring tasks (cron jobs) to run automatically at specified times. Cron is the standard Linux task scheduler, used for backups, log rotation, reports, maintenance, and any periodic task. Each user has their own crontab. The cron format specifies minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where 0 and 7 are Sunday). crontab provides a reliable, simple way to automate tasks. System-wide cron jobs go in /etc/crontab or /etc/cron.d/. Per-user jobs are managed with the crontab command.

Syntax

crontab [OPTION]... [FILE]

Key Options

  • -e โ€” Edit your crontab
  • -l โ€” List your crontab
  • -r โ€” Remove your crontab
  • -u USER โ€” Edit another user crontab (root only)

Examples

Edit crontab

crontab -e

List cron jobs

crontab -l

Output: 0 2 * * * /usr/local/bin/backup.sh\n*/5 * * * * /usr/local/bin/check_health.sh

Every 5 minutes

*/5 * * * * /path/to/script.sh

Pro Tips

  • minute hour day-of-month month day-of-week. * means every. */5 means every 5. 1,15 means 1st and 15th.
  • Cron uses minimal PATH. Always use full paths in cron jobs: /usr/local/bin/python3 instead of python3.
  • Cron sends output as email. Redirect to log: >> /var/log/cron.log 2>&1. Or discard: > /dev/null 2>&1.

Learn more: Full crontab reference โ†’

Share this tip