crontabvim
系統調度進程。可使用它在天天的非高峯負荷時間段運行做業,或在一週或一月中的不一樣時段運行。bash
使用它在一個特定的時間運行一些特殊的做業,或在晚一些的非負荷高峯時
間段或高峯負荷時間段運行。spa
1. crontab -e 進程
2. vim cronscript and add content eg: 0-59 * * * * echo `date` >> /home/xxx/cron.outputcrontab
關於: 0-59 * * * * 格式可參照 /etc/crontab ip
cat /etc/crontab it
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 executed
一共五個* ,在實際的例子中* 能夠理解爲「每」的意思io
0-59 * * * * 能夠理解爲每個月的每一天,每一天中的每個小時,每一小時的每一分鐘執行。。。。操做date
crontab -rcommand