| 用途 | 正确管理 cron 守护进程 |
|---|---|
| RHEL | crond(cronie) |
| Debian | cron(vixie-cron 血统) |
启停与状态
启停与状态
# RHEL/CentOS/Rocky
sudo systemctl restart crond
sudo systemctl status crond --no-pager
# Debian/Ubuntu
sudo systemctl restart cron
sudo systemctl status cron --no-pager
# 兼容写法
sudo systemctl restart cron 2>/dev/null || sudo systemctl restart crond确认版本实现
确认版本实现
crontab --version 2>&1 | head -n 2 # cronie 会打印版本信息改 crontab/cron.d 不需要重启服务(守护按分钟重读);重启只用于配置损坏、进程卡死等场景。