Linux command
cron 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Edit crontab
crontab -e
List cron jobs
crontab -l
Remove crontab
crontab -r
Edit another user's crontab
sudo crontab -u [user] -e
Install crontab from file
crontab [crontab.txt]
说明
cron is the daemon that executes scheduled commands. crontab manages per-user cron tables. Together they provide time-based job scheduling for automated system maintenance, backups, log rotation, and recurring tasks. The cron daemon starts at boot and runs continuously, waking up every minute to check all crontab files for jobs that need execution. Each user can have their own crontab file, and the system has crontabs for system-wide maintenance. Jobs run in the background without user interaction, making cron essential for Unix/Linux system administration.
FAQ
What is the cron command used for?
cron is the daemon that executes scheduled commands. crontab manages per-user cron tables. Together they provide time-based job scheduling for automated system maintenance, backups, log rotation, and recurring tasks. The cron daemon starts at boot and runs continuously, waking up every minute to check all crontab files for jobs that need execution. Each user can have their own crontab file, and the system has crontabs for system-wide maintenance. Jobs run in the background without user interaction, making cron essential for Unix/Linux system administration.
How do I run a basic cron example?
Run `crontab -e` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more cron examples?
This page includes 5 examples for cron, plus related commands for nearby Linux tasks.