在 Debian 里“定时器”可能指几种不同的东西,下面按常见情况分别说明怎么查看。
Debian 9 及以后默认使用 systemd,很多定时任务是通过 timer 单元 实现的。
systemctl list-timers
只看启用的:
systemctl list-timers --all
systemctl status xxx.timer
systemctl cat xxx.timer
systemctl list-timers xxx.timer
ls -l /etc/cron.*
cat /etc/crontab
查看当前用户:
crontab -l
查看指定用户(需 root):
crontab -l -u username
journalctl -u cron
# 或
grep CRON /var/log/syslog
cat /etc/anacrontab
查看待执行任务:
atq
查看具体内容:
at -c 任务号
systemctl list-timers | head
crontab -l
如果你能说明 “定时器”是指系统更新、备份、还是某个服务,我可以给你更精确的查看命令。