|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
每天早上6点0 6 * * * echo "Good morning." >> /tmp/test.txt //注意单纯echo,从屏幕上看不到任何输出,因为cron把任何输出都email到root的信箱了。每两个小时0 */2 * * * echo "Have a break now." >> /tmp/test.txt 晚上11点到早上8点之间每两个小时和早上八点0 23-7/2,8 * * * echo "Have a good dream" >> /tmp/test.txt每个月的4号和每个礼拜的礼拜一到礼拜三的早上11点0 11 4 * 1-3 command line1月1日早上4点0 4 1 1 * command line每小时(第一分钟)执行/etc/cron.hourly内的脚本01 * * * * root run-parts /etc/cron.hourly每天(凌晨4:02)执行/etc/cron.daily内的脚本02 4 * * * root run-parts /etc/cron.daily每星期(周日凌晨4:22)执行/etc/cron.weekly内的脚本22 4 * * 0 root run-parts /etc/cron.weekly每月(1号凌晨4:42)去执行/etc/cron.monthly内的脚本42 4 1 * * root run-parts /etc/cron.monthly注意: "run-parts"这个参数了,如果去掉这个参数的话,后面就可以写要运行的某个脚本名,而不是文件夹名。 每天的下午4点、5点、6点的5 min、15 min、25 min、35 min、45 min、55 min时执行命令。5,15,25,35,45,55 16,17,18 * * * command每周一,三,五的下午3:00系统进入维护状态,重新启动系统。00 15 * *1,3,5 shutdown -r +5每小时的10分,40分执行用户目录下的innd/bbslin这个指令:10,40 * * * * innd/bbslink每小时的1分执行用户目录下的bin/account这个指令:1 * * * * bin/account每天早晨三点二十分执行用户目录下如下所示的两个指令(每个指令以;分隔):203 * * * (/bin/rm -f expire.ls logins.bad;bin/expire$#@62;expire.1st) 每年的一月和四月,4号到9号的3点12分和3点55分执行/bin/rm -f expire.1st这个指令,并把结果添加在mm.txt这个文件之后(mm.txt文件位于用户自己的目录位置)。12,553 4-91,4 * /bin/rm -f expire.1st$#@62;$#@62;mm.txt |
原文:http://www.cnblogs.com/Rozdy/p/4496501.html