Linux/Unix 蝟餌絞 crontab 蝔撘舐其霈蝟餌絞雿輻刻芾閮剖券閬 嚗閬鈭
+ `5 O9 A( R0 ~( Y4 {8 U* N" r' V7 Y) @: @# W& o+ N$ n$ |6 r. x. F
靘憒雿輻刻臭誑閮剖瘥銝拐8暺芸ftp 唳啣餅瑼獢嚗 瘥憭拙憭3暺芸隞質蝑...閬摰鋆蝵殷閮園扯撣貉酉 /usr/sbin/crond 蝔撘銝 Linux 券璈芸頛伐憒潛曄 crond 刻嚗臭誑 /etc/rc.d/init.d/ 桅銝臬行撠瑁crond 蝔撘隞文仿璈芸瑁瑼鋆⊿U憒賣銵函內瘝摰鋆crond, CentOS 銝芾銝隞
# G/ F' f/ ?& ]6 |yum install vixie-cron 撠勗臬鋆摰. T6 n0 M9 r% I
; _, m$ `' E3 q7 ?% O
雿輻刻臭誑 crontab -e(摮瑼敺喳餌) 隞支蝺典神閬撌乩撖怠其 file 鋆∴瑁 crontab filename 撠勗臭誑鈭雿輻刻 crontab 瑼賣摮 /var/spool/cron/ 銝,瑼撠望航府撣唾摮,靘憒 root' Q. C: x) C$ K* J; |
crontab 澆憒銝嚗
( t+ Q5 K( Y3 f6 A1 A) a3 J0 x
/ S2 j0 B6 w# F: Z; I# E3 ~ 閬瑁隞
5 |% ?# m! n1 H* D9 F/ x靘憒:
8 y% _6 v J) h* {0 _
& A& E, [6 u% ~+ ?3 n30 12 * * * /usr/bin/rm xxx.txt$ _) `1 {$ H1 U$ O" M5 j8 M
g4 E/ ~* u6 O+ P% {' a 12:30 撠 xxx.txt 瑼獢畾箸6 a% I1 o2 D' z( I/ x
* 銵函內瘥交瘥賢瑁5 W: l, P% a0 {
血撖 crontab 瘜冽敹雿輻 蝯撠頝臬憒 rm 瑁瑼 敹撖急 /usr/bin/rm
1 {; q# S" A% c9 ^) f; _, I& h靘:# every two hours at the top of the hour0 H4 u! ?0 s7 L+ a2 u( K
0 */2 * * * date
3 Y ?; j0 g; K- B. `/ Y0 Z # every two hours from 11p.m. to 7a.m., and at 8a.m.
L7 t0 w$ `7 s3 X U' ?( t 0 23-7/2,8 * * * date
7 `4 ? y6 e% b: V' O
9 }) f. D8 I5 Z8 {渲底蝝啣臬: http://linux.vbird.org/linux_basic/0430cron.php
/ ]) t7 I9 k; [3 V& e$ n% m/ G% V0 B( ?' U# s
' d1 H% g/ t( w% h8 _! b R
, i3 c) l7 _; y, M% h! @/ x7 w7 l$ c) |: E
|
|