-
启动cron服务
systemctl start crond
- 设置开机启动
systemctl start crond.service
- 添加一个定时任务
crontab -e
*/1 * * * * echo $(cat /proc/sys/kernel/random/uuid) >> /opt/data/access_log
ps:每分钟将随机字符串插入access_log文件
- 查看定时任务列表
[root@xxx~]# crontab -l
*/1 * * * * echo $(cat /proc/sys/kernel/random/uuid) >> /opt/data/access_log
-
查看执行日志
tailf /var/log/cron