[root@ansible-db log]#cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin(请注意:crontab的PATH变量与系统的PATH变量不同,可能会导致部分命令无法使用,crontab执行shell时只能识别为数不多的系统环境变量,解决办法就是要执行的语句都放在脚本中,同时在脚本中声明变量)
MAILTO=root
# 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
[root@ansible-db log]# echo $PATH
/usr/local/redis/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin