14.4.Cron 和 Periodic
14.4.1. Cron
# /etc/crontab - root 的 crontab 配置文件
#
①
#
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin ②
#
#分钟 小时 日期 月份 星期 用户 命令 ③
#
# 每 11 分钟保存一些熵,以便 /dev/random 在启动时重新播种。
*/11 * * * * operator /usr/libexec/save-entropy ④
#
# 每小时轮换日志文件(如果需要)。
0 * * * * root newsyslog
#
# 执行日常/每周/每月维护。
1 3 * * * root periodic daily
15 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly
#
# 如果 CMOS 时钟保持本地时间,而不是 UTC 时间,则调整时区。
# 详情请参见 adjkerntz(8)。
1,31 0-5 * * * root adjkerntz -a14.4.2. 创建用户 Crontab
14.4.3. Periodic
14.4.4. 启用或禁用周期性任务
14.4.5. 配置周期性任务的输出
最后更新于