crontab -e
在里面添加 需要定时的任务
如:
58 23 * * * bash /home/log_daochu2.sh > /home//log.log 2>/home/log_error.log
python
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
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 execute
#每天 每隔5,10,15,20,30分钟执行一次定时任务
*/5 * * * * root /data0/myshell/collect5m.sh
#*/10 * * * * root /data0/myshell/collect10m.sh
#*/15 * * * * root /data0/myshell/collect15m.sh
#*/20 * * * * root /data0/myshell/collect20m.sh
#*/30 * * * * root /data0/myshell/collect30m.sh