cron 同步使用

yum apt 安装不解释

配置文件目录 可以写在 cron.d 里面

[root@wh15366 ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
1
2
3
4

For details see man 4 crontabs

Example of job definition:

# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
1
2
3
4
5
6
7

例子 每一分钟把文件写到 home/mydatetest

* * * * * root date >> /home/mydatetest
1

log 文件

tail -f /var/log/cron
1
上次更新: 11/3/2018, 12:13:24 PM