Linux/Unix 蝟餌絞 crontab 蝔撘舐其霈蝟餌絞雿輻刻芾閮剖券閬 嚗閬鈭
& o- f, Z4 S8 t& } ?6 y8 m" b3 n4 F6 |5 y' Y9 \
靘憒雿輻刻臭誑閮剖瘥銝拐8暺芸ftp 唳啣餅瑼獢嚗 瘥憭拙憭3暺芸隞質蝑...閬摰鋆蝵殷閮園扯撣貉酉 /usr/sbin/crond 蝔撘銝 Linux 券璈芸頛伐憒潛曄 crond 刻嚗臭誑 /etc/rc.d/init.d/ 桅銝臬行撠瑁crond 蝔撘隞文仿璈芸瑁瑼鋆⊿U憒賣銵函內瘝摰鋆crond, CentOS 銝芾銝隞 5 ~" n) e9 D1 i0 Q5 K4 B7 D
yum install vixie-cron 撠勗臬鋆摰
9 x$ ` ~) n ]% k" O
# N; u1 e/ Z5 A& q/ d6 l雿輻刻臭誑 crontab -e(摮瑼敺喳餌) 隞支蝺典神閬撌乩撖怠其 file 鋆∴瑁 crontab filename 撠勗臭誑鈭雿輻刻 crontab 瑼賣摮 /var/spool/cron/ 銝,瑼撠望航府撣唾摮,靘憒 root
% p- c& g$ U7 |+ i$ J3 v- Bcrontab 澆憒銝嚗6 c8 I( m: C4 S! Z) u6 }0 C, D
. H3 U# y7 X& K! x' N
閬瑁隞
7 f5 U0 a; j% X% Z0 {- o靘憒:& s, c" p2 R6 X" k/ p
+ {& l& _( l) h0 S1 W30 12 * * * /usr/bin/rm xxx.txt& {% p k4 I! ]$ L% @
7 f3 o1 y5 {' ]
12:30 撠 xxx.txt 瑼獢畾箸
4 _& {' I0 l, m6 c8 i$ f* 銵函內瘥交瘥賢瑁4 H, x/ J/ V6 y, g; M3 e
血撖 crontab 瘜冽敹雿輻 蝯撠頝臬憒 rm 瑁瑼 敹撖急 /usr/bin/rm! N5 X l! b; A( |% p: x- |
靘:# every two hours at the top of the hour
6 {( M) G7 r+ O+ f1 c" N5 r8 ^ 0 */2 * * * date) l9 C. p% z$ C1 c5 _" K
# every two hours from 11p.m. to 7a.m., and at 8a.m.2 N) {* N0 L+ J! t
0 23-7/2,8 * * * date; {2 [* X! e+ a# W
% S6 n `( P5 G# d2 T+ p: v5 m渲底蝝啣臬: http://linux.vbird.org/linux_basic/0430cron.php
7 `% G9 I# C( J8 }7 q; M7 N$ a$ y* s% x6 }+ u3 c7 z
, U) p, B9 x8 h9 _( @% D4 C a. w8 z, c2 o! a
! |9 r' q2 n7 `6 {6 v' W0 G |
|