Linux/Unix 蝟餌絞 crontab 蝔撘舐其霈蝟餌絞雿輻刻芾閮剖券閬 嚗閬鈭
/ h! a0 t. v7 e. ~5 V; u% X" I8 R
靘憒雿輻刻臭誑閮剖瘥銝拐8暺芸ftp 唳啣餅瑼獢嚗 瘥憭拙憭3暺芸隞質蝑...閬摰鋆蝵殷閮園扯撣貉酉 /usr/sbin/crond 蝔撘銝 Linux 券璈芸頛伐憒潛曄 crond 刻嚗臭誑 /etc/rc.d/init.d/ 桅銝臬行撠瑁crond 蝔撘隞文仿璈芸瑁瑼鋆⊿U憒賣銵函內瘝摰鋆crond, CentOS 銝芾銝隞
, }$ Q! P& l: W, Oyum install vixie-cron 撠勗臬鋆摰$ I; ~8 H# p. A( [
$ I" N6 L# O }. z/ U0 \% P2 x- D雿輻刻臭誑 crontab -e(摮瑼敺喳餌) 隞支蝺典神閬撌乩撖怠其 file 鋆∴瑁 crontab filename 撠勗臭誑鈭雿輻刻 crontab 瑼賣摮 /var/spool/cron/ 銝,瑼撠望航府撣唾摮,靘憒 root. C$ D, G8 w8 L9 f, R5 h
crontab 澆憒銝嚗+ {: y# w( ^3 z# }. {. g5 |6 L/ X/ {
+ C- ^- }/ ]1 f 閬瑁隞
$ D7 E! w' D* V% E靘憒:
1 c C3 ~' H1 X7 _" {( j) ^* u D' x( j% [1 V% T( o
30 12 * * * /usr/bin/rm xxx.txt
; R# b2 O* @! m. G& R( `* M+ g. p8 c( R) V" C# M9 I, d
12:30 撠 xxx.txt 瑼獢畾箸6 n$ d0 c, i' _; P( Q: ^
* 銵函內瘥交瘥賢瑁& S0 y3 Z; y, I2 j& g% I B8 h
血撖 crontab 瘜冽敹雿輻 蝯撠頝臬憒 rm 瑁瑼 敹撖急 /usr/bin/rm
6 p$ A/ w$ Q8 Z& Z6 T0 q靘:# every two hours at the top of the hour
4 s9 L% L6 D9 I9 w. [4 g& { 0 */2 * * * date/ n/ Z0 Q- K% _* B
# every two hours from 11p.m. to 7a.m., and at 8a.m.$ ?1 t9 q7 K& w
0 23-7/2,8 * * * date
7 r% g' P2 |: y7 A: r' a( D4 @
4 ?2 M& k' W* y* l: J8 V渲底蝝啣臬: http://linux.vbird.org/linux_basic/0430cron.php
6 \( w3 s) o0 X/ ^' R) q6 [
+ g, C0 H# c _* W3 g) |$ [! ]) B
1 e! c% ]" }) f( s
3 o: _" y* `4 ^+ V2 x2 p' b |
|