Linux/Unix 蝟餌絞 crontab 蝔撘舐其霈蝟餌絞雿輻刻芾閮剖券閬 嚗閬鈭0 f4 R+ L0 A1 u
% E& D8 D: }5 k) k6 G靘憒雿輻刻臭誑閮剖瘥銝拐8暺芸ftp 唳啣餅瑼獢嚗 瘥憭拙憭3暺芸隞質蝑...閬摰鋆蝵殷閮園扯撣貉酉 /usr/sbin/crond 蝔撘銝 Linux 券璈芸頛伐憒潛曄 crond 刻嚗臭誑 /etc/rc.d/init.d/ 桅銝臬行撠瑁crond 蝔撘隞文仿璈芸瑁瑼鋆⊿U憒賣銵函內瘝摰鋆crond, CentOS 銝芾銝隞
$ g7 X2 s4 H5 N/ }* o2 qyum install vixie-cron 撠勗臬鋆摰
- y( N4 z9 p0 Y/ b3 y4 ?
3 s; Y) y% K" ^4 w雿輻刻臭誑 crontab -e(摮瑼敺喳餌) 隞支蝺典神閬撌乩撖怠其 file 鋆∴瑁 crontab filename 撠勗臭誑鈭雿輻刻 crontab 瑼賣摮 /var/spool/cron/ 銝,瑼撠望航府撣唾摮,靘憒 root+ {7 }. T6 @( i* l, k- C' F- q
crontab 澆憒銝嚗
: x& M4 M, [% W% b5 H) y1 D/ ~
" I" q- ^& `3 ?9 @ 閬瑁隞
' l" e. l% m4 v v靘憒:3 G# w" q1 E i" T/ F% O! u3 [
9 z( G- t" w: d9 M30 12 * * * /usr/bin/rm xxx.txt
* l* t* C/ a, w0 d, o% L/ A: \. v2 T' l6 q/ ?
12:30 撠 xxx.txt 瑼獢畾箸
- u' C! c9 n3 {$ ~: V) m* 銵函內瘥交瘥賢瑁7 u; z9 W+ M7 {4 m
血撖 crontab 瘜冽敹雿輻 蝯撠頝臬憒 rm 瑁瑼 敹撖急 /usr/bin/rm& v5 |: C7 d: f) r |( g, j/ ]5 x
靘:# every two hours at the top of the hour: Y. A- ? J4 g- E/ U( w1 x
0 */2 * * * date1 R) {$ A7 v# e
# every two hours from 11p.m. to 7a.m., and at 8a.m.
2 s( V+ z" g0 E8 E5 F) M( e" |/ X 0 23-7/2,8 * * * date
5 I9 E1 \) y" _ o
# K' b6 V& s+ ~6 D* X0 ^渲底蝝啣臬: http://linux.vbird.org/linux_basic/0430cron.php
, k! A( I5 O' L' w% s
I6 `" Z: A3 K; \% [- }6 h5 Z" f( N2 I3 a: {: t
5 }& J+ p& J; b% \: Q
/ m8 L" H+ m8 X |
|