crontab
Schedule recurring tasks using cron daemon time-based job scheduler.
Synopsis
crontab [OPTION]... [FILE]
Examples
crontab -l
crontab -e
sudo crontab -l -u www-data
echo '0 2 * * * /backup.sh' | crontab -
Common options
| Flag | Description |
|---|---|
| -e | Edit current user's crontab |
| -l | List current crontab |
| -r | Remove current crontab |
| -u | Specify user |
About crontab
The `crontab` command schedule recurring tasks using cron daemon time-based job scheduler. Service and system commands manage daemons, scheduled tasks, system boot, and shutdown operations.
Modern Linux distributions use systemd for service management, though some still support SysVinit scripts. Understanding these commands is essential for deploying and maintaining production services.
The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man crontab`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Service & System Commands
Other commands in the Service & System category