crontab
Quick Reference
Command Name:
crontab
Category:
system scheduling
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Scheduled backups
Automate regular backup tasks at specific times
- 2
System maintenance
Schedule routine maintenance tasks like log rotation or cleanup
- 3
Periodic reporting
Generate and send reports on a regular schedule
- 4
Automated monitoring
Run system checks and monitoring scripts at defined intervals
Syntax
crontab [-u user] file crontab [-u user] [-l | -r | -e] [-i]
Options
Option | Description |
---|---|
-l |
List the current crontab |
-r |
Remove the current crontab |
-e |
Edit the current crontab |
-i |
Prompt for confirmation before removing crontab |
-u user |
Specify the user whose crontab to manage (requires appropriate privileges) |
Examples
How to Use These Examples
The examples below show common ways to use the crontab
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
# List your cron jobs crontab -l
Advanced Examples:
# List another user's crontab (requires root privileges) sudo crontab -u username -l