Linux/Unix 蝟餌絞 crontab 蝔撘舐其霈蝟餌絞雿輻刻芾閮剖券閬 嚗閬鈭
K+ O! V' I: v% A; |8 r
8 v6 R- l, a _靘憒雿輻刻臭誑閮剖瘥銝拐8暺芸ftp 唳啣餅瑼獢嚗 瘥憭拙憭3暺芸隞質蝑...閬摰鋆蝵殷閮園扯撣貉酉 /usr/sbin/crond 蝔撘銝 Linux 券璈芸頛伐憒潛曄 crond 刻嚗臭誑 /etc/rc.d/init.d/ 桅銝臬行撠瑁crond 蝔撘隞文仿璈芸瑁瑼鋆⊿U憒賣銵函內瘝摰鋆crond, CentOS 銝芾銝隞 0 a( N; {" k5 B
yum install vixie-cron 撠勗臬鋆摰9 R. |5 G: g( l d* ^3 h! k( l
# n ~5 B9 v5 {% L }) m& [9 K雿輻刻臭誑 crontab -e(摮瑼敺喳餌) 隞支蝺典神閬撌乩撖怠其 file 鋆∴瑁 crontab filename 撠勗臭誑鈭雿輻刻 crontab 瑼賣摮 /var/spool/cron/ 銝,瑼撠望航府撣唾摮,靘憒 root8 T) ]" ]. ?1 h+ v4 J
crontab 澆憒銝嚗2 W% `4 k6 r/ b' X' E0 |) F" G9 w
2 a( T* h) G/ S+ |6 R 閬瑁隞: d2 e1 l/ ^8 Z1 d7 R+ K
靘憒:# r' T* ], y) ^5 p8 R; M: k ^
6 v; X3 |( O' Y3 l
30 12 * * * /usr/bin/rm xxx.txt
2 X% q0 e/ s/ q: y) N
6 [, U( P, ] Z/ m8 Q. S. ^8 ` 12:30 撠 xxx.txt 瑼獢畾箸
: C! s( f* G3 Y+ I* 銵函內瘥交瘥賢瑁
% b9 w- }2 y. [) j, O血撖 crontab 瘜冽敹雿輻 蝯撠頝臬憒 rm 瑁瑼 敹撖急 /usr/bin/rm1 D7 x* |3 B% c
靘:# every two hours at the top of the hour
4 _, E# z; B- w( @1 a6 N 0 */2 * * * date
. F4 @- e4 B1 H+ Z" I/ f # every two hours from 11p.m. to 7a.m., and at 8a.m.+ Q& I7 w U; n; T* C9 ~) R9 c
0 23-7/2,8 * * * date7 p2 N! p/ Y8 C
c ~0 u$ ^. m Q9 Y
渲底蝝啣臬: http://linux.vbird.org/linux_basic/0430cron.php4 P5 v8 _. W! E
3 r4 O5 x) h4 z6 }6 a$ F
; D4 `- ~! A% v0 j
0 Z- _- w7 j8 Q# @7 l m
) C# e' z( V' W# H I |
|