锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产成人精品久久亚洲高清不卡,蜜芽亚洲av无码一区二区三区,91亚洲精品自在在线观看http://m.tkk7.com/loocky/archive/2007/11/22/162301.html灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author>Thu, 22 Nov 2007 02:41:00 GMThttp://m.tkk7.com/loocky/archive/2007/11/22/162301.htmlhttp://m.tkk7.com/loocky/comments/162301.htmlhttp://m.tkk7.com/loocky/archive/2007/11/22/162301.html#Feedback2http://m.tkk7.com/loocky/comments/commentRss/162301.htmlhttp://m.tkk7.com/loocky/services/trackbacks/162301.html闃呰鍏ㄦ枃

]]>
鐢↗ACORB鎼緩涓涓猚orba鐨勫紑鍙戠幆澧?/title><link>http://m.tkk7.com/loocky/archive/2007/11/21/162026.html</link><dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator><author>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author><pubDate>Wed, 21 Nov 2007 02:36:00 GMT</pubDate><guid>http://m.tkk7.com/loocky/archive/2007/11/21/162026.html</guid><wfw:comment>http://m.tkk7.com/loocky/comments/162026.html</wfw:comment><comments>http://m.tkk7.com/loocky/archive/2007/11/21/162026.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://m.tkk7.com/loocky/comments/commentRss/162026.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/loocky/services/trackbacks/162026.html</trackback:ping><description><![CDATA[<p>                   how to setup jacorb dev env<br /> 1:download JacORB_2_2</p> <p>       http://www.jacorb.org/download.html <br />   download ant<br />        http://ant.apache.org/bindownload.cgi</p> <p>2:extact JacORB_2_2.jar to d:\JacORB_2_2 </p> <p>3:setup sys environment</p> <p>       set ANT_HOME=<br />        set JAVA_HOME=<br />        set JACORB_HOME=d:\JacORB_2_2<br />        set PATH=%PATH%;%ANT_HOME%\bin;%JAVA_HOME%\bin;%JACORB_HOME%\bin;<br />        set CLASSPAHT=.;%CLASSPAHT%;%ANT_HOME%\lib\ant.jar;%JACORB_HOME%\lib\jarorb.jar;%JACORB_HOME%\lib\idl.jar\;%JACORB_HOME%\lib\logkit-1.2.jar</p> <p>4:rename %JACORB_HOME%\etc\jacorb_properties.template to %JACORB_HOME%\etc\jacorb.properties<br />   and modify the 50th line to 53th line to<br />   <br />        #ORBInitRef.NameService=file:/y:/nsiona.ref<br />        <br /> ORBInitRef.NameService=file://d://test//NS_Ref<br />        <br /> #ORBInitRef.NameService=http://www.x.y.z/~user/NS_Ref<br />        <br /> #ORBInitRef.TradingService=http://www.x.y.z/~user/TraderRef<br />   <br />   modify 618th line to<br />        jacorb.naming.ior_filename=d://test//NS_Ref</p> <p>5:rename  %JACORB_HOME%\jacotemplate.bat to %JACORB_HOME%\jaco.bat<br />   <br />   and modify related env variable<br />   <br />   rename   %JACORB_HOME%\idltemplate.bat to %JACORB_HOME%\idl.bat<br />    <br />   and modify related env variable</p> <p> </p> <p>6:  use ant compile and build idl and java</p> <p><br />      cd  %JACORB_HOME%\demo\grid   </p> <p>     run ant<br />     <br />      the generate class file in %JACORB_HOME%\classes  and generated java file in %JACORB_HOME%\demo\grid</p> <p><br /> 7: open a new cmd window:<br />           cd %JACORB_HOME%   ns <br />   <br />    you can see the following result:    <br />        [ configuration jacorb loaded from file %JAORB_HOME%\etc\jacorb.properties]</p> <p>   open a new cmd window:<br />           cd %JACORB_HOME%   jaco demo.grid.Server<br />   you can see the following result:    <br />   [ configuration jacorb loaded from file %JAORB_HOME%\etc\jacorb.properties]<br />    <br />   open a new cmd window:<br />           cd %JACORB_HOME%   jaco demo.grid.client<br />     you can see the following result:    <br />   <br />   [ configuration jacorb loaded from file D:\work\nj\JACORB\etc\jacorb.properties]<br />    Height = 31<br />    Width = 14<br />    Old value at (30,13): 0.21<br />    Setting (30,13) to 470.11<br />    New value at (30,13): 470.11<br />    MyException, reason: This is only a test exception, no harm done :-)<br />    done.</p><img src ="http://m.tkk7.com/loocky/aggbug/162026.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/loocky/" target="_blank">灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/a> 2007-11-21 10:36 <a href="http://m.tkk7.com/loocky/archive/2007/11/21/162026.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Oracle 璇硶涔?OVER (PARTITION BY ..) 鍙婂紑紿楀嚱鏁?杞澆http://m.tkk7.com/loocky/archive/2007/11/13/160213.html灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author>Tue, 13 Nov 2007 05:33:00 GMThttp://m.tkk7.com/loocky/archive/2007/11/13/160213.htmlhttp://m.tkk7.com/loocky/comments/160213.htmlhttp://m.tkk7.com/loocky/archive/2007/11/13/160213.html#Feedback13http://m.tkk7.com/loocky/comments/commentRss/160213.htmlhttp://m.tkk7.com/loocky/services/trackbacks/160213.html
oracle鐨勫垎鏋愬嚱鏁皁ver 鍙婂紑紿楀嚱鏁?/div>
涓錛氬垎鏋愬嚱鏁?strong style="color: black; background-color: #a0ffff">over
Oracle浠?.1.6寮濮嬫彁渚涘垎鏋愬嚱鏁幫紝鍒嗘瀽鍑芥暟鐢ㄤ簬璁$畻鍩轟簬緇勭殑鏌愮鑱氬悎鍊鹼紝瀹冨拰鑱氬悎鍑芥暟鐨勪笉鍚屼箣澶勬槸
瀵逛簬姣忎釜緇勮繑鍥炲琛岋紝鑰岃仛鍚堝嚱鏁板浜庢瘡涓粍鍙繑鍥炰竴琛屻?
涓嬮潰閫氳繃鍑犱釜渚嬪瓙鏉ヨ鏄庡叾搴旂敤銆?nbsp;                                      
1錛氱粺璁℃煇鍟嗗簵鐨勮惀涓氶銆?nbsp;       
     date       sale
     1           20
     2           15
     3           14
     4           18
     5           30
    瑙勫垯錛氭寜澶╃粺璁★細姣忓ぉ閮界粺璁″墠闈㈠嚑澶╃殑鎬婚
    寰楀埌鐨勭粨鏋滐細
    DATE   SALE       SUM
    ----- -------- ------
    1      20        20           --1澶?nbsp;          
    2      15        35           --1澶╋紜2澶?nbsp;          
    3      14        49           --1澶╋紜2澶╋紜3澶?nbsp;          
    4      18        67            .          
    5      30        97            .
     
2:緇熻鍚勭彮鎴愮嘩絎竴鍚嶇殑鍚屽淇℃伅
    NAME   CLASS S                         
    ----- ----- ----------------------
    fda    1      80                     
    ffd    1      78                     
    dss    1      95                     
    cfe    2      74                     
    gds    2      92                     
    gf     3      99                     
    ddd    3      99                     
    adf    3      45                     
    asdf   3      55                     
    3dd    3      78              
   
    閫氳繃錛?nbsp;  
    --
    select * from                                                                       
    (                                                                            
    select name,class,s,rank()over(partition by class order by s desc) mm from t2
    )                                                                            
    where mm=1
    --
    寰楀埌緇撴灉錛?br />     NAME   CLASS S                       MM                                                                                        
    ----- ----- ---------------------- ----------------------
    dss    1      95                      1                      
    gds    2      92                      1                      
    gf     3      99                      1                      
    ddd    3      99                      1          
   
    娉ㄦ剰錛?br />     1.鍦ㄦ眰絎竴鍚嶆垚緇╃殑鏃跺欙紝涓嶈兘鐢╮ow_number()錛屽洜涓哄鏋滃悓鐝湁涓や釜騫跺垪絎竴錛宺ow_number()鍙繑鍥炰竴涓粨鏋?nbsp;         
    2.rank()鍜宒ense_rank()鐨勫尯鍒槸錛?br />       --rank()鏄煩璺冩帓搴忥紝鏈変袱涓浜屽悕鏃舵帴涓嬫潵灝辨槸絎洓鍚?br />       --dense_rank()l鏄繛緇帓搴忥紝鏈変袱涓浜屽悕鏃朵粛鐒惰窡鐫絎笁鍚?br />      
     
3.鍒嗙被緇熻 (騫舵樉紺轟俊鎭?
    A   B   C                      
    -- -- ----------------------
    m   a   2                      
    n   a   3                      
    m   a   2                      
    n   b   2                      
    n   b   1                      
    x   b   3                      
    x   b   2                      
    x   b   4                      
    h   b   3
   select a,c,sum(c)over(partition by a) from t2                
   寰楀埌緇撴灉錛?br />    A   B   C        SUM(C)OVER(PARTITIONBYA)      
   -- -- ------- ------------------------
   h   b   3        3                        
   m   a   2        4                        
   m   a   2        4                        
   n   a   3        6                        
   n   b   2        6                        
   n   b   1        6                        
   x   b   3        9                        
   x   b   2        9                        
   x   b   4        9                        
  
   濡傛灉鐢╯um錛実roup by 鍒欏彧鑳藉緱鍒?br />    A   SUM(C)                            
   -- ----------------------
   h   3                      
   m   4                      
   n   6                      
   x   9                      
   鏃犳硶寰楀埌B鍒楀?nbsp;      
  
錛濓紳錛濓紳錛?/font>

select * from test

鏁版嵁:
A B C
1 1 1
1 2 2
1 3 3
2 2 5
3 4 6


---灝咮鏍忎綅鍊肩浉鍚岀殑瀵瑰簲鐨凜 鏍忎綅鍊煎姞鎬?br /> select a,b,c, SUM(C) OVER (PARTITION BY B) C_Sum
from test

A B C C_SUM
1 1 1 1
1 2 2 7
2 2 5 7
1 3 3 3
3 4 6 6



---濡傛灉涓嶉渶瑕佸凡鏌愪釜鏍忎綅鐨勫煎垎鍓?閭e氨瑕佺敤 null

eg: 灝辨槸灝咰鐨勬爮浣嶅約ummary 鏀懼湪姣忚鍚庨潰

select a,b,c, SUM(C) OVER (PARTITION BY null) C_Sum
from test

A B C C_SUM
1 1 1 17
1 2 2 17
1 3 3 17
2 2 5 17
3 4 6 17

 

姹備釜浜哄伐璧勫崰閮ㄩ棬宸ヨ祫鐨勭櫨鍒嗘瘮

SQL> select * from salary;

NAME DEPT SAL
---------- ---- -----
a 10 2000
b 10 3000
c 10 5000
d 20 4000

SQL> select name,dept,sal,sal*100/sum(sal) over(partition by dept) percent from salary;

NAME DEPT SAL PERCENT
---------- ---- ----- ----------
a 10 2000 20
b 10 3000 30
c 10 5000 50
d 20 4000 100

浜岋細寮紿楀嚱鏁?nbsp;          
      寮紿楀嚱鏁版寚瀹氫簡鍒嗘瀽鍑芥暟宸ヤ綔鐨勬暟鎹獥鍙eぇ灝忥紝榪欎釜鏁版嵁紿楀彛澶у皬鍙兘浼氶殢鐫琛岀殑鍙樺寲鑰屽彉鍖栵紝涓句緥濡備笅錛?
1錛?nbsp;    
   over錛坥rder by salary錛?鎸夌収salary鎺掑簭榪涜绱錛宱rder by鏄釜榛樿鐨勫紑紿楀嚱鏁?br />    over錛坧artition by deptno錛夋寜鐓ч儴闂ㄥ垎鍖?br /> 2錛?br />   over錛坥rder by salary range between 5 preceding and 5 following錛?br />    姣忚瀵瑰簲鐨勬暟鎹獥鍙f槸涔嬪墠琛屽箙搴﹀間笉瓚呰繃5錛屼箣鍚庤騫呭害鍊間笉瓚呰繃5
   渚嬪:瀵逛簬浠ヤ笅鍒?br />      aa
     1
     2
     2
     2
     3
     4
     5
     6
     7
     9
   
   sum(aa)over錛坥rder by aa range between 2 preceding and 2 following錛?br />    寰楀嚭鐨勭粨鏋滄槸
            AA                       SUM
            ---------------------- -------------------------------------------------------
            1                       10                                                      
            2                       14                                                      
            2                       14                                                      
            2                       14                                                      
            3                       18                                                      
            4                       18                                                      
            5                       22                                                      
            6                       18                                                                
            7                       22                                                                
            9                       9                                                                 
             
   灝辨槸璇達紝瀵逛簬aa=5鐨勪竴琛?錛宻um涓?nbsp;  5-1<=aa<=5+2 鐨勫拰
   瀵逛簬aa=2鏉ヨ 錛宻um=1+2+2+2+3+4=14     錛?br />    鍙堝 瀵逛簬aa=9 錛?-1<=aa<=9+2 鍙湁9涓涓暟錛屾墍浠um=9    錛?br />               
3錛氬叾瀹冿細
     over錛坥rder by salary rows between 2 preceding and 4 following錛?br />           姣忚瀵瑰簲鐨勬暟鎹獥鍙f槸涔嬪墠2琛岋紝涔嬪悗4琛?
4錛氫笅闈笁鏉¤鍙ョ瓑鏁堬細           
     over錛坥rder by salary rows between unbounded preceding and unbounded following錛?br />           姣忚瀵瑰簲鐨勬暟鎹獥鍙f槸浠庣涓琛屽埌鏈鍚庝竴琛岋紝絳夋晥錛?br />      over錛坥rder by salary range between unbounded preceding and unbounded following錛?br />            絳夋晥
     over(partition by null)


]]>
JMS澶嶄範http://m.tkk7.com/loocky/archive/2007/08/15/136816.html灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author>Wed, 15 Aug 2007 01:20:00 GMThttp://m.tkk7.com/loocky/archive/2007/08/15/136816.htmlhttp://m.tkk7.com/loocky/comments/136816.htmlhttp://m.tkk7.com/loocky/archive/2007/08/15/136816.html#Feedback0http://m.tkk7.com/loocky/comments/commentRss/136816.htmlhttp://m.tkk7.com/loocky/services/trackbacks/136816.html鐢變簬涓浜涘師鍥狅紝鏈榪戣澶嶄範涓浜涗笢瑗匡紝鎵浠ュ氨鎶奐MS鐨勪笢瑗垮啀澶嶄範涓閬嶏紝浠ヤ笅渚挎槸渚嬪瓙

jms 涓渶閲嶈鐨勫嚑涓蹇礵estination錛孉CKNOWLEDGE錛宻ubscribe,durable subscribe

destination錛歵opic queque
  queue綆鍗曠偣璇村氨鏄?:1 涓涓秷鎭彧鑳界敱涓涓猚onsumer鍘繪秷璐癸紝鍒殑consumer鏉ユ秷璐圭殑鏃跺欏凡緇忔病浜嗭紝鍏堝埌鍏堝緱
topic綆鍗曠偣璇村氨鏄?:N 涓涓秷鎭彲浠ョ敱澶氫釜consumer鏉ユ秷璐癸紝璋佹潵娑堣垂閮芥湁
 subscribe錛屾嬁topic鏉ヨ濡傛灉褰撳墠璁㈤槄涓嶆槸鎸佷箙璁㈤槄錛屽彧鏈夊啀璁㈤槄鍚庣敓浜ц呯敓浜у緱娑堟伅鎵嶈兘琚玞onsumer寰楀埌錛屾寔涔呰闃呭彧瑕佹病鏈夎consumer娑堣垂錛屾棭鏅氫細娑堣垂榪欎釜娑堟伅
 
 
 
 涓涓嬫槸鍑犱釜渚嬪瓙
 
 queuesend錛歲ueque娑堟伅浜х敓
 queuereceive錛歲ueque娑堟伅寰楁秷璐?br />  topicsend 錛歵opic娑堟伅寰椾駭鐢?br />  topicreceive1錛歵opic娑堟伅鐨勯潪璁㈤槄
 topicrecieve2錛歵opic娑堟伅鐨勬寔涔呰闃?br />  
 榪欎釜渚嬪瓙瀹炲湪WEBLOGIC814涓婃祴璇曡繃鐨勶紝褰撶劧瑕佸畾涔塉MSSERVER,FACTORY,DESTINATION銆?br />  
 
 
 QueueSend
 
 import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class QueueSend {
 // Defines the JNDI context factory.
 public final static String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";

 // Defines the JNDI provider url.
 public final static String PROVIDER_URL = " t3://localhost:7001";

 // Defines the JMS connection factory for the queue.
 public final static String JMS_FACTORY = "SendJMSFactory";

 // Defines the queue.
 public final static String QUEUE = "SendJMSQueue";

 private QueueConnectionFactory qconFactory;

 private QueueConnection qcon;

 private QueueSession qsession;

 private QueueSender qsender;

 private Queue queue;

 private TextMessage msg;

 /**
  * Creates all the necessary objects for sending messages to a JMS queue.
  *
  * @param ctx
  *            JNDI initial context
  * @param queueName
  *            name of queue
  * @exception NamingException
  *                if operation cannot be performed
  * @exception JMSException
  *                if JMS fails to initialize due to internal error
  */
 public void init(Context ctx, String queueName) throws NamingException,
   JMSException {
  qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
  qcon = qconFactory.createQueueConnection();
  qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
  queue = (Queue) ctx.lookup(queueName);
  qsender = qsession.createSender(queue);
  msg = qsession.createTextMessage();
  qcon.start();
 }

 /**
  * Sends a message to a JMS queue.
  *
  * @param message
  *            message to be sent
  * @exception JMSException
  *                if JMS fails to send message due to internal error
  */
 public void send(String message) throws JMSException {
  msg.setText(message);
  qsender.send(msg);
 }

 /**
  * Closes JMS objects.
  *
  * @exception JMSException
  *                if JMS fails to close objects due to internal error
  */
 public void close() throws JMSException {
  qsender.close();
  qsession.close();
  qcon.close();
 }

 /**
  * main() method.
  *
  * @param args
  *            WebLogic Server URL
  * @exception Exception
  *                if operation fails
  */
 public static void main(String[] args) throws Exception {
  try {
   InitialContext ic = getInitialContext();
   QueueSend qs = new QueueSend();
   qs.init(ic, QUEUE);
   readAndSend(qs);
   qs.close();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }

 private static void readAndSend(QueueSend qs) throws IOException,
   JMSException {
  BufferedReader msgStream = new BufferedReader(new InputStreamReader(
    System.in));
  String line = null;
  boolean quitNow = false;
  do {
   System.out.print("Enter message (\"quit\" to quit): ");
   line = msgStream.readLine();
   if (line != null && line.trim().length() != 0) {
    qs.send(line);
    System.out.println("JMS Message Sent: " + line + "\n");
    quitNow = line.equalsIgnoreCase("quit");
   }
  } while (!quitNow);

 }

 private static InitialContext getInitialContext() throws NamingException {
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
  env.put(Context.PROVIDER_URL, PROVIDER_URL);
  return new InitialContext(env);
 }

}


QueueReceive

import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class QueueReceive implements MessageListener {
 // Defines the JNDI context factory.
 public final static String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";

 // Defines the JNDI provider url.
 public final static String PROVIDER_URL = " t3://localhost:7001";

 // Defines the JMS connection factory for the queue.
 public final static String JMS_FACTORY = "SendJMSFactory";

 // Defines the queue.
 public final static String QUEUE = "SendJMSQueue";

 private QueueConnectionFactory qconFactory;

 private QueueConnection qcon;

 private QueueSession qsession;

 private QueueReceiver qreceiver;

 private Queue queue;

 private boolean quit = false;

 /**
  * Message listener interface.
  *
  * @param msg
  *            message
  */
 public void onMessage(Message msg) {
  try {
   String msgText;
   if (msg instanceof TextMessage) {
    msgText = ((TextMessage) msg).getText();
   } else {
    msgText = msg.toString();
   }

   System.out.println("Message Received: " + msgText);

//   if (msgText.equalsIgnoreCase("123")) {
//    synchronized (this) {
//     quit = true;
//     this.notifyAll(); // Notify main thread to quit
//    }
//   }
  } catch (JMSException jmse) {
   jmse.printStackTrace();
  }
 }

 /**
  * Creates all the necessary objects for receiving messages from a JMS
  * queue.
  *
  * @param ctx
  *            JNDI initial context
  * @param queueName
  *            name of queue
  * @exception NamingException
  *                if operation cannot be performed
  * @exception JMSException
  *                if JMS fails to initialize due to internal error
  */
 public void init(Context ctx, String queueName) throws NamingException,
   JMSException {
  qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
  qcon = qconFactory.createQueueConnection();
  qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
  queue = (Queue) ctx.lookup(queueName);
  qreceiver = qsession.createReceiver(queue);
  qreceiver.setMessageListener(this);
  qcon.start();
 }

 /**
  * Closes JMS objects.
  *
  * @exception JMSException
  *                if JMS fails to close objects due to internal error
  */
 public void close() throws JMSException {
  qreceiver.close();
  qsession.close();
  qcon.close();
 }

 /**
  * main() method.
  *
  * @param args
  *            WebLogic Server URL
  * @exception Exception
  *                if execution fails
  */

 public static void main(String[] args) throws Exception {

  InitialContext ic = getInitialContext();
  QueueReceive qr = new QueueReceive();
  qr.init(ic, QUEUE);

  System.out
    .println("JMS Ready To Receive Messages (To quit, send a \"quit\" message).");

  // Wait until a "quit" message has been received.
  synchronized (qr) {
   System.out.println("111111111111");
   while (!qr.quit) {
    try {
     System.out.println("2222222222");
     qr.wait();
     System.out.println("333333333");
    } catch (InterruptedException ie) {
    }
   }
  }
  qr.close();
 }

 private static InitialContext getInitialContext() throws NamingException {
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
  env.put(Context.PROVIDER_URL, PROVIDER_URL);
  return new InitialContext(env);
 }

}

 

TopicSend

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicSession;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.TopicPublisher;
public class TopicSend {
 // Defines the JNDI context factory.
 public final static String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";

 // Defines the JNDI provider url.
 public final static String PROVIDER_URL = " t3://localhost:7001";

 // Defines the JMS connection factory for the queue.
 public final static String JMS_FACTORY = "SendJMSFactory";

 // Defines the queue.
 public final static String TOPIC = "SendJMSTopic";

 private TopicConnectionFactory tconFactory;

 private TopicConnection tcon;

 private TopicSession tsession;

 private TopicPublisher tsender;

 private Topic topic;

 private TextMessage msg;
 public static InitialContext ic ;

 /**
  * Creates all the necessary objects for sending messages to a JMS queue.
  *
  * @param ctx
  *            JNDI initial context
  * @param queueName
  *            name of queue
  * @exception NamingException
  *                if operation cannot be performed
  * @exception JMSException
  *                if JMS fails to initialize due to internal error
  */
 public void init(Context ctx, String queueName) throws NamingException,
   JMSException {
  tconFactory = (TopicConnectionFactory) ctx.lookup(JMS_FACTORY);
  tcon = tconFactory.createTopicConnection();
  tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
  System.out.println(topic);
  topic = (Topic) ctx.lookup(queueName);
  System.out.println(topic);
  tsender = tsession.createPublisher(topic);
  msg = tsession.createTextMessage();
  tcon.start();
 }

 /**
  * Sends a message to a JMS queue.
  *
  * @param message
  *            message to be sent
  * @exception JMSException
  *                if JMS fails to send message due to internal error
  */
 public void send(String message) throws JMSException ,NamingException{
  System.out.println(topic+"-----------");
  msg.setText(message);
  tsender.publish(msg);
 }

 /**
  * Closes JMS objects.
  *
  * @exception JMSException
  *                if JMS fails to close objects due to internal error
  */
 public void close() throws JMSException {
  tsender.close();
  tsession.close();
  tcon.close();
 }

 /**
  * main() method.
  *
  * @param args
  *            WebLogic Server URL
  * @exception Exception
  *                if operation fails
  */
 public static void main(String[] args) throws Exception {
  try {
   ic= getInitialContext();
   TopicSend ts = new TopicSend();
   ts.init(ic, TOPIC);
   readAndSend(ts);
   ts.close();
  } catch (Exception e) {
   e.printStackTrace();
  }
 }

 private static void readAndSend(TopicSend ts) throws IOException,
   JMSException,NamingException {
  BufferedReader msgStream = new BufferedReader(new InputStreamReader(
    System.in));
  String line = null;
  boolean quitNow = false;
  do {
   System.out.print("Enter message (\"quit\" to quit): ");
   line = msgStream.readLine();
   if (line != null && line.trim().length() != 0) {
    ts.send(line);
   
    System.out.println("JMS Message Sent: " + line + "\n");
    quitNow = line.equalsIgnoreCase("quit");
   }
  } while (!quitNow);

 }

 private static InitialContext getInitialContext() throws NamingException {
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
  env.put(Context.PROVIDER_URL, PROVIDER_URL);
  return new InitialContext(env);
 }

}

 

TopicReceive1

import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class TopicReceive1 implements MessageListener {
 // Defines the JNDI context factory.
 public final static String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";

 // Defines the JNDI provider url.
 public final static String PROVIDER_URL = " t3://localhost:7001";

 // Defines the JMS connection factory for the queue.
 public final static String JMS_FACTORY = "SendJMSFactory";

 // Defines the queue.
 public final static String TOPIC = "SendJMSTopic";

 private TopicConnectionFactory tconFactory;

 private TopicConnection tcon;

 private TopicSession tsession;

 private TopicSubscriber tsubscriber;

 private Topic topic;

 private boolean quit = false;

 /**
  * Message listener interface.
  *
  * @param msg
  *            message
  */
 public void onMessage(Message msg) {
  System.out.println("===================");
  try {
   String msgText;
   if (msg instanceof TextMessage) {
    msgText = ((TextMessage) msg).getText();
   } else {
    msgText = msg.toString();
   }

   System.out.println("Message Received: " + msgText);

//   if (msgText.equalsIgnoreCase("123")) {
//    synchronized (this) {
//     quit = true;
//     this.notifyAll(); // Notify main thread to quit
//    }
//   }
  } catch (JMSException jmse) {
   jmse.printStackTrace();
  }
 }

 /**
  * Creates all the necessary objects for receiving messages from a JMS
  * queue.
  *
  * @param ctx
  *            JNDI initial context
  * @param queueName
  *            name of queue
  * @exception NamingException
  *                if operation cannot be performed
  * @exception JMSException
  *                if JMS fails to initialize due to internal error
  */
 public void init(Context ctx, String queueName) throws NamingException,
   JMSException {
  tconFactory = (TopicConnectionFactory) ctx.lookup(JMS_FACTORY);
  tcon = tconFactory.createTopicConnection();
  tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
  topic = (Topic) ctx.lookup(queueName);
  tsubscriber = tsession.createSubscriber(topic);
  //System.out.println("12");
  //Message msg = treceiver.receive();
  //msg.acknowledge();
  //tsubscriber = tsession.createSubscriber(topic);Message msg = tsubscriber.receive();msg.acknowledge();
  //System.out.println(msg);
  tsubscriber.setMessageListener(this);
  tcon.start();
 }

 /**
  * Closes JMS objects.
  *
  * @exception JMSException
  *                if JMS fails to close objects due to internal error
  */
 public void close() throws JMSException {
  tsubscriber.close();
  tsession.close();
  tcon.close();
 }

 /**
  * main() method.
  *
  * @param args
  *            WebLogic Server URL
  * @exception Exception
  *                if execution fails
  */

 public static void main(String[] args) throws Exception {

  InitialContext ic = getInitialContext();
  TopicReceive1 tr1 = new TopicReceive1();
  tr1.init(ic, TOPIC);

  System.out
    .println("JMS Ready To Receive Messages (To quit, send a \"quit\" message).");
  
  

  // Wait until a "quit" message has been received.
//  synchronized (tr1) {
//   System.out.println("111111111111");
//   while (!tr1.quit) {
//    try {
//     System.out.println("2222222222");
//     tr1.wait();
//     System.out.println("333333333");
//    } catch (InterruptedException ie) {
//    }
//   }
//  }
  tr1.close();
 }

 private static InitialContext getInitialContext() throws NamingException {
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
  env.put(Context.PROVIDER_URL, PROVIDER_URL);
  return new InitialContext(env);
 }

}


TopicReceive2


import java.util.Hashtable;

import javax.jms.JMSException;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


public class TopicReceive2 {
 // Defines the JNDI context factory.
 public final static String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";

 // Defines the JNDI provider url.
 public final static String PROVIDER_URL = " t3://localhost:7001";

 // Defines the JMS connection factory for the queue.
 public final static String JMS_FACTORY = "SendJMSFactory";

 // Defines the queue.
 public final static String TOPIC = "SendJMSTopic";

 private TopicConnectionFactory tconFactory;

 private TopicConnection tcon;

 private TopicSession tsession;

 private TopicSubscriber tsubscriber;

 private Topic topic;

 private boolean quit = false;


 /**
  * Creates all the necessary objects for receiving messages from a JMS
  * queue.
  *
  * @param ctx
  *            JNDI initial context
  * @param queueName
  *            name of queue
  * @exception NamingException
  *                if operation cannot be performed
  * @exception JMSException
  *                if JMS fails to initialize due to internal error
  */
 public void init(Context ctx, String queueName) throws NamingException,
   JMSException,InterruptedException {
  tconFactory = (TopicConnectionFactory) ctx.lookup(JMS_FACTORY);
  tcon = tconFactory.createTopicConnection();
  tcon.setClientID("IP10.200.7.104");
  tcon.start();
  
  tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
  System.out.println("333333333333");
  topic = (Topic) ctx.lookup(queueName);
  //tsubscriber = tsession.createSubscriber(topic);
  tsubscriber= tsession.createDurableSubscriber(topic,"88888");
   for (int i=0; i<3; i++) {
             //
             TextMessage message = (TextMessage) tsubscriber.receive();
             System.out.println("message["+i+"]: " + message.getText());
         }
          Thread.sleep(10000);
  //System.out.println("12");
  //Message msg = treceiver.receive();
  //msg.acknowledge();
  //tsubscriber = tsession.createSubscriber(topic);Message msg = tsubscriber.receive();msg.acknowledge();
  //System.out.println(msg);

 }

 /**
  * Closes JMS objects.
  *
  * @exception JMSException
  *                if JMS fails to close objects due to internal error
  */
 public void close() throws JMSException {
  tsubscriber.close();
  tsession.close();
  tcon.close();
 }

 /**
  * main() method.
  *
  * @param args
  *            WebLogic Server URL
  * @exception Exception
  *                if execution fails
  */

 public static void main(String[] args) throws Exception {

  InitialContext ic = getInitialContext();
  TopicReceive2 tr2 = new TopicReceive2();
  tr2.init(ic, TOPIC);

  System.out
    .println("JMS Ready To Receive Messages (To quit, send a \"quit\" message).");
  
  

  // Wait until a "quit" message has been received.
//  synchronized (tr1) {
//   System.out.println("111111111111");
//   while (!tr1.quit) {
//    try {
//     System.out.println("2222222222");
//     tr1.wait();
//     System.out.println("333333333");
//    } catch (InterruptedException ie) {
//    }
//   }
//  }
  tr2.close();
 }

 private static InitialContext getInitialContext() throws NamingException {
  Hashtable env = new Hashtable();
  env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
  env.put(Context.PROVIDER_URL, PROVIDER_URL);
  return new InitialContext(env);
 }

}



]]>
Linux涓嬭蔣浠跺畨瑁呮柟娉曟葷粨(杞?http://m.tkk7.com/loocky/archive/2007/08/10/135711.html灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author>Fri, 10 Aug 2007 01:39:00 GMThttp://m.tkk7.com/loocky/archive/2007/08/10/135711.htmlhttp://m.tkk7.com/loocky/comments/135711.htmlhttp://m.tkk7.com/loocky/archive/2007/08/10/135711.html#Feedback0http://m.tkk7.com/loocky/comments/commentRss/135711.htmlhttp://m.tkk7.com/loocky/services/trackbacks/135711.html
涓銆乺pm鍖呭畨瑁呮柟寮忔楠わ細
寮曠敤:

1銆佹壘鍒扮浉搴旂殑杞歡鍖咃紝姣斿soft.version.rpm錛屼笅杞藉埌鏈満鏌愪釜鐩綍錛?br>
2銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
3銆乧d soft.version.rpm鎵鍦ㄧ殑鐩綍錛?br>
4銆佽緭鍏pm -ivh soft.version.rpm




浜屻乨eb鍖呭畨瑁呮柟寮忔楠わ細

寮曠敤:
1銆佹壘鍒扮浉搴旂殑杞歡鍖咃紝姣斿soft.version.deb錛屼笅杞藉埌鏈満鏌愪釜鐩綍錛?br>
2銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
3銆乧d soft.version.deb鎵鍦ㄧ殑鐩綍錛?br>
4銆佽緭鍏pkg -i soft.version.deb




涓夈乼ar.gz婧愪唬鐮佸寘瀹夎鏂瑰紡錛?br>
寮曠敤:
1銆佹壘鍒扮浉搴旂殑杞歡鍖咃紝姣斿soft.tar.gz錛屼笅杞藉埌鏈満鏌愪釜鐩綍錛?br>
2銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
3銆乧d soft.tar.gz鎵鍦ㄧ殑鐩綍錛?br>
4銆乼ar -xzvf soft.tar.gz //涓鑸細鐢熸垚涓涓猻oft鐩綍

5銆乧d soft

6銆?/configure

7銆乵ake

8銆乵ake install




鍥涖乼ar.bz2婧愪唬鐮佸寘瀹夎鏂瑰紡錛?br>
寮曠敤:
1銆佹壘鍒扮浉搴旂殑杞歡鍖咃紝姣斿soft.tar.bz2錛屼笅杞藉埌鏈満鏌愪釜鐩綍錛?br>
2銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
3銆乧d soft.tar.bz2鎵鍦ㄧ殑鐩綍錛?br>
4銆乼ar -xjvf soft.tar.bz2 //涓鑸細鐢熸垚涓涓猻oft鐩綍

5銆乧d soft

6銆?/configure

7銆乵ake

8銆乵ake install




浜斻乤pt鏂瑰紡瀹夎錛?br>
寮曠敤:
1銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
2銆乤pt-cache search soft 娉細soft鏄綘瑕佹壘鐨勮蔣浠剁殑鍚嶇О鎴栫浉鍏充俊鎭?br>
3銆佸鏋?涓壘鍒頒簡杞歡soft.version錛屽垯鐢╝pt-get install soft.version鍛戒護瀹夎杞歡 娉細鍙浣犲彲浠ヤ笂緗戯紝鍙渶瑕佺敤apt-cache search鏌ユ壘杞歡錛岀敤apt-get install杞歡




鍏乥in鏂囦歡瀹夎錛?br>
濡傛灉浣犱笅杞藉埌鐨勮蔣浠跺悕鏄痵oft.bin錛屼竴鑸儏鍐典笅鏄釜鍙墽琛屾枃浠訛紝瀹夎鏂規硶濡備笅錛?br>
寮曠敤:
1銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
2銆乧hmod +x soft.bin

3銆?/soft.bin //榪愯榪欎釜鍛戒護灝卞彲浠ュ畨瑁呰蔣浠朵簡




涓冦佷笉闇瑕佸畨瑁呯殑杞歡錛?br>
鏈変簡浜涜蔣浠訛紝姣斿lumaqq錛屾槸涓嶉渶瑕佸畨瑁呯殑錛岃嚜甯re瑙e帇緙╁悗鍙洿鎺ヨ繍琛屻傚亣璁句笅杞界殑鏄痩umaqq.tar.gz錛屼嬌鐢ㄦ柟娉曞涓嬶細

寮曠敤:
1銆佹墦寮涓涓粓绔紝su -鎴恟oot鐢ㄦ埛錛?br>
2銆乼ar -xzvf lumaqq.tar.gz //榪欎竴姝ヤ細鐢熸垚涓涓彨LumaQQ鐨勭洰褰?br>
3銆乧d LumaQQ

4銆乧hmod +x lumaqq //璁劇疆lumaqq榪欎釜紼嬪簭鏂囦歡涓哄彲榪愯

5銆佹鏃跺氨鍙互榪愯lumaqq浜嗭紝鐢ㄥ懡浠?/lumaqq鍗沖彲錛屼絾姣忔榪愯瑕佽緭鍏ュ叏璺緞鎴栧垏鎹㈠埌鍒氭墠鐢熸垚鐨凩umaQQ鐩綍閲?br>
6銆佷負浜嗕繚璇佷笉璁劇疆璺緞灝卞彲浠ョ敤錛屼綘鍙互鍦?bin鐩綍涓嬪緩绔嬩竴涓猯umaqq鐨勯摼鎺ワ紝鐢ㄥ懡浠n -s lumaqq /bin/ 鍗沖彲錛屼互鍚庝換浣曟椂鍊欐墦寮涓涓粓绔緭鍏umaqq灝卞彲浠ュ惎鍔≦Q鑱婂ぉ杞歡浜?br>
7銆佸鏋滀綘瑕佹兂lumaqq鏈変釜鑿滃崟欏癸紝浣跨敤鑿滃崟緙栬緫宸ュ叿錛屾瘮濡侫lacarte Menu Editor錛屾壘鍒頒笂闈㈢敓鎴愮殑LumaQQ鐩綍閲岀殑lumaqq璁劇疆涓涓彍鍗曢」灝卞彲浠ヤ簡錛屽綋鐒朵綘涔熷彲浠ョ洿鎺ュ埌 /usr/share/applications鐩綍錛屾寜鐓ч噷闈㈠叾瀹?.desktop鏂囦歡鐨勬牸寮忕敓鎴愪竴涓嚜宸辯殑desktop鏂囦歡鍗沖彲銆?/div>


]]>
璁″垝浠誨姟宸ュ叿 cron 鐨勯厤緗拰璇存槑 杞嚜linuxsir.orghttp://m.tkk7.com/loocky/archive/2007/07/24/132008.html灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author>Tue, 24 Jul 2007 03:14:00 GMThttp://m.tkk7.com/loocky/archive/2007/07/24/132008.htmlhttp://m.tkk7.com/loocky/comments/132008.htmlhttp://m.tkk7.com/loocky/archive/2007/07/24/132008.html#Feedback0http://m.tkk7.com/loocky/comments/commentRss/132008.htmlhttp://m.tkk7.com/loocky/services/trackbacks/132008.html璁″垝浠誨姟宸ュ叿 cron 鐨勯厤緗拰璇存槑

浣滆咃細鍖楀崡鍗楀寳
鏉ヨ嚜錛?/strong>LinuxSir.Org
鎽樿錛?/strong>Linux鎿嶄綔緋葷粺涓紝璁″垝浠誨姟閫氬父鐢眂ron鏉ユ壙鎷咃紝浜嗚В鎴栨帉鎻ron錛岃兘涓烘垜浠鐞嗘湇鍔″櫒甯︽潵鏇村鐨勪究鍒╋紝涔熻兘鐪佸嵈鏇村鐨勬椂闂淬傛湰鏂囦篃涓句簡涓浜涚畝鍗曟槑浜嗙殑渚嬪瓙錛屼負浜嗚鏂版墜涓婅礬鏂逛究錛?/p>

鐩綍


++++++++++++++++++++++++++++++++++++++
姝f枃
++++++++++++++++++++++++++++++++++++++


1銆佽鍒掍換鍔℃璇達紱

璁″垝浠誨姟錛屾槸浠誨姟鍦ㄧ害瀹氱殑鏃墮棿鎵ц宸茬粡璁″垝濂界殑宸ヤ綔錛岃繖鏄〃闈㈢殑鎰忔濄傚湪Linux涓紝鎴戜滑緇忓父鐢ㄥ埌 crond 鏈嶅姟鍣ㄦ潵瀹屾垚榪欓」宸ヤ綔銆俢ron鏈嶅姟鍣ㄥ彲浠ユ牴鎹厤緗枃浠剁害瀹氱殑鏃墮棿鏉ユ墽琛岀壒瀹氱殑浣滃姟銆傛瘮濡傛垜浠彲浠ュ湪閰嶇疆鏂囦歡涓害瀹氭瘡澶╂棭涓?鐐癸紝瀵筯ttpd 鏈嶅姟鍣ㄩ噸鏂板惎鍔紝榪欏氨鏄竴涓鍒掍換鍔★紱

涓嬮潰鎴戜滑鍏堟潵璇磋cron錛?/p>


2銆乧ron錛?br>

鍦↙inux緋葷粺涓紝璁″垝浠誨姟涓鑸槸鐢眂ron鎵挎媴錛屾垜浠彲浠ユ妸cron璁劇疆涓哄紑鏈烘椂鑷姩鍚姩銆俢ron鍚姩鍚庯紝瀹冧細璇誨彇瀹冪殑鎵鏈夐厤緗枃浠訛紙鍏ㄥ眬鎬ч厤緗枃浠?etc/crontab錛屼互鍙婃瘡涓敤鎴風殑璁″垝浠誨姟閰嶇疆鏂囦歡錛夛紝鐒跺悗cron浼氭牴鎹懡浠ゅ拰鎵ц鏃墮棿鏉ユ寜鏃舵潵璋冪敤搴﹀伐浣滀換鍔°?/p>


2.1 cron 鐨勫畨瑁呭拰鍚姩錛?br>

鍦ㄤ竴鑸儏鍐典笅錛宑ron閮芥槸緋葷粺榛樿瀹夎鐨勶紝鎴戜滑瑕佸浼氭煡鐪嬭蔣浠跺寘鏄惁宸茬粡瀹夎錛?/p>


2.1.1 鍦≧edhat 鎴?Fedora絳塕PM鍖呯鐞嗙殑緋葷粺鐨勫畨瑁咃紱

鍒ゆ柇緋葷粺鏄惁宸茬粡瀹夎cron鐩稿叧鐨勫寘

Fedora 5.0 緋葷粺鐨勬儏鍐碉紱

鍏跺畠鐗堟湰鐨凢edora鍙奟edhat鐨勭郴緇熷拰榪欑浉浼鹼紱

[root@localhost ~]# rpm -qa |grep cron
vixie-cron-4.1-54.FC5
anacron-2.3-36.1
crontabs-1.10-7.1

 

鍏朵腑vixie-cron杞歡鍖呮槸cron鐨勪富紼嬪簭錛屾偍鍙互閫氳繃涓嬮潰鐨勫懡浠ゆ潵浜嗚В瀹冿紝鍏跺畠杞歡鍖呭悓鐞嗭紱

[root@localhost beinan]# rpm -ql vixie-cron

 

crontabs 杞歡鍖呮槸鐢ㄦ潵瀹夎銆佸嵏瑁呫佹垨鍒椾婦鐢ㄦ潵椹卞姩 cron 瀹堟姢榪涚▼鐨勮〃鏍肩殑紼嬪簭銆俢ron 瀹堟姢榪涚▼媯鏌?crontab 鏂囦歡鏉ユ煡鐪嬫煇涓寚瀹氬懡浠よ璋冨害鎵ц鐨勬椂闂淬傚鏋滃懡浠ゅ凡緇忚皟搴︼紝瀹堟姢榪涚▼灝變細鎵ц瀹冧滑銆備簡瑙rontabs杞歡鍖呴兘瀹夎浜嗕簺浠涔堬紝搴旇鐢ㄤ笅闈㈢殑鍛戒護錛?/p>

[root@localhost beinan]# rpm -ql crontabs

 

濡傛灉娌℃湁瀹夎錛屽彲浠ヤ粠鍏夌洏涓壘鍑烘枃浠跺悕甯︽湁cron瀛楁牱鐨勮蔣浠跺寘鏉ュ畨瑁呫?/p>

[root@localhost ~]# rpm -ivh vixie-cron-4.1-54.FC5*
[root@localhost ~]# rpm -ivh crontabs*

 

涔熷彲浠ョ敤yum 鏉ュ湪綰垮畨瑁咃紱

[root@localhost ~]# yum install vixie-cron
[root@localhost ~]# yum install crontabs

 


2.1.2 鍦⊿lackware緋葷粺涓殑瀹夎錛?br>

鍦⊿lackware涓璫ron杞歡鍖呮槸 dcron錛屾偍鍙互鍦ㄥ厜鐩樹腑鎵懼嚭鏉ュ畨瑁呭畠錛?/p>

鏌ョ湅鏄惁宸茬粡瀹夎浜哾cron杞歡鍖咃紝鎮ㄥ彲浠ヨ繖鏍鋒煡鐪嬨傚湪榪欓噷鑳藉垪鍑鴻蔣浠跺寘璇︾粏鐨勫畨瑁呮儏鍐碉紱

[root@localhost ~]# more /var/adm/packages/dcron*

 

濡傛灉娌℃湁瀹夎錛岃鐢ㄤ笅闈㈢殑鍛戒護鏉ュ畨瑁呫傚湪絎竴寮犲畨瑁呯洏涓壘鍑篸cron杞歡鍖咃紱

[root@localhost ~]# installpkg dcron*.tgz

 


2.1.3 cron 鐨勫紑鍚佸仠姝€侀噸鏂板惎鍔ㄦ柟娉曪紱

cron閰嶇疆鏂囦歡琚慨鏀瑰悗錛屾兂璁╂柊鏂囦歡鐢熸晥錛屽繀欏婚噸鏂癱rond鏈嶅姟鍣紝鏈変袱縐嶆柟娉曞彲渚涢夋嫨錛?/p>


絎竴縐?鍦‵edora鎴朢edhat 絳変互RPM鍖呯鐞嗙殑緋葷粺涓紱

[root@localhost ~]# /etc/init.d/crond start
[root@localhost ~]# /etc/init.d/crond stop
[root@localhost ~]# /etc/init.d/crond restart

 

濡傛灉鎯沖湪Fedora 鍜?Redhat 鎴栦互榪欎簺鍙戣鐗堜負鍩虹鍏嬮殕鐨勫彂琛岀増錛屽鏋滄兂鑷姩寮鏈鴻繍琛岋紝璇風敤涓嬮潰鐨勫姙娉曪紱

[root@localhost ~]# chkconfig --levels 35 crond on

 

絎簩縐嶏細閫氱敤

[root@localhost ~]# pgrep crond 娉細鍒ゆ柇crond 鏄惁鍦ㄨ繍琛岋紱
[root@localhost ~]# pkill crond 娉細鏉鎺夋鍦ㄨ繍琛屼腑鐨刢rond錛?br>[root@localhost ~]# pgrep crond 娉細鏌ョ湅鏄惁琚潃鎺変簡錛?br>[root@localhost ~]# /usr/sbin/crond 娉細榪愯crond錛?/code>

 


2.2 cron 閰嶇疆鏂囦歡錛?br>

cron 鏄竴涓湇鍔″櫒紼嬪簭錛屾垜浠兘鐭ラ亾Linux鐨勬湇鍔″櫒鐨勯厤緗紝澶у鏄氳繃閰嶇疆鏂囦歡鏉ュ畬鎴愮殑錛宑ron鑷劧涔熶笉渚嬪錛屽湪Redhat/Fedora 絳夌郴緇熶腑瀹冪殑鍏ㄥ眬鎬ч厤緗枃浠舵槸/etc/crontab錛涘湪Slackware緋葷粺涓紝鍏ㄥ眬鎬ф枃浠舵槸/var/spool/cron/crontabs/root 銆傛瘡涓敤鎴蜂篃鏈夎嚜宸辯殑cron閰嶇疆鏂囦歡錛屾垜浠彲浠ラ氳繃crontab -e 鏉ョ紪杈戝畠錛?/p>


2.2.1 鍏ㄥ眬鎬ч厤緗枃浠訛紱

涓嬮潰鏄竴涓叏灞鎬х殑閰嶇疆鏂囦歡渚嬪瓙錛屼互Fedora Core 5涓轟緥錛?/p>

[root@localhost ~]# more /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
1 * * * * root run-parts /etc/cron.hourly
#
2 4 * * * root run-parts /etc/cron.daily
#
22 4 * * 7 root run-parts /etc/cron.weekly
#
42 4 1 * * root run-parts /etc/cron.monthly
#
0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg

 

瀵逛簬鍏ㄥ眬鎬ч厤緗枃浠訛紝鎴戜滑瑕佺敤root鏉冮檺鏉ユ洿鏀癸紝涓鑸槸閫氳繃crontab -e 鏉ヤ慨鏀廣備絾鏈夋椂涔熷茍涓嶄竴瀹氭槸榪欐牱鐨勶紝姣斿Fedora Core 5 濡傛灉閫氳繃crontab -e 淇敼鐨勬槸root鐢ㄦ埛鐨刢ron 閰嶇疆鏂囦歡銆傛墍浠ユ垜浠鍦‵edora Core 5涓慨鏀瑰叏灞鎬ч厤緗枃浠跺彲浠ョ敤vi 緙栬緫鍣ㄦ潵淇敼銆倂i鐨勭敤娉曡鍙傝冿細銆婃枃浠剁紪杈戝櫒 vi銆?/font>

鍦ㄥ叏灞鎬ч厤緗枃浠朵腑錛屽畾涔変簡鍙墽琛屽懡浠ょ殑璺緞鐜鍙橀噺錛屾墍鐢⊿HELL綾誨瀷鐨勫畾涔夌瓑錛岃繖浜涘ぇ澶氫笉鐢ㄤ慨鏀癸紱鎴戜滑緇忓父娣誨姞鐨勬槸璁″垝浠誨姟鎴栦慨鏀逛換鍔℃墽琛岀殑鏃墮棿絳夛紱

鍦ㄥ叏灞鎬ч厤緗枃浠朵腑錛屾垜浠彂鐜版湁綾諱技榪欎簺琛岋紱

1 * * * * root run-parts /etc/cron.hourly 娉細琛ㄧず姣忎釜灝忔椂鐨勭涓鍒嗛挓錛屽紑濮嬫墽琛?etc/hourly鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?br>2 4 * * * root run-parts /etc/cron.daily 娉細琛ㄧず姣忓ぉ鐨?鐐?鍒嗭紝寮濮嬫墽琛?etc/cron.daily鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?br>22 4 * * 7 root run-parts /etc/cron.weekly 娉細姣忓勾絎?涓懆4鐐規垜22鍒嗭紝寮濮嬫墽琛?/etc/cron.weekly鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?br>42 4 1 * * root run-parts /etc/cron.monthly 娉細姣忔湀絎?澶╃殑4鐐?2鍒嗭紝寮濮嬫墽琛?etc/cron.monthly鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?/code>

 

榪欎簺琛屾槸鐢ㄦ潵鍦ㄥ悓涓鏃墮棿鎵歸噺鎵ц浠誨姟鐨勶紝鎴戜滑鍦ㄤ互鍚庣殑渚嬪瓙涓嫭绔嬪嚭鏉ヨВ璇達紝鍦ㄨ繖閲屽彧鏄澶у蹇冧腑鏈夋暟錛?/p>


2.2.2 cron 閰嶇疆璁″垝浠誨姟鐨勪功鍐欐牸寮?br>

鍒嗛挓 灝忔椂 鏃?鏈?鍛?錛葷敤鎴峰悕錛?鍛戒護

 

璇存槑錛?/strong>

絎竴孌靛簲璇ュ畾涔夌殑鏄細鍒嗛挓錛岃〃紺烘瘡涓皬鏃剁殑絎嚑鍒嗛挓鏉ユ墽琛屻傝寖鍥存槸浠?-59
        絎簩孌靛簲璇ュ畾涔夌殑鏄細灝忔椂錛岃〃紺轟粠絎嚑涓皬鏃舵潵鎵ц錛岃寖鍥存槸浠?-23
        絎笁孌靛簲璇ュ畾涔夌殑鏄細鏃ユ湡錛岃〃紺轟粠姣忎釜鏈堢殑絎嚑澶╂墽琛岋紝鑼冨洿浠?-31
        絎洓孌靛簲璇ュ畾涔夌殑鏄細鏈堬紝琛ㄧず姣忓勾鐨勭鍑犱釜鏈堟潵鎵ц錛岃寖鍥翠粠1-12
        絎簲孌靛簲璇ュ畾涔夌殑鏄細鍛紝琛ㄧず姣忓懆鐨勭鍑犲ぉ鎵ц錛岃寖鍥翠粠0-6錛屽叾涓?0琛ㄧず鏄熸湡鏃ャ?
        姣忓叚孌靛簲璇ュ畾涔夌殑鏄細鐢ㄦ埛鍚嶏紝涔熷氨鏄墽琛岀▼搴忚閫氳繃鍝釜鐢ㄦ埛鏉ユ墽琛岋紝榪欎釜涓鑸彲浠ョ渷鐣ワ紱
        絎竷孌靛簲璇ュ畾涔夌殑鏄細鎵ц鐨勫懡浠ゅ拰鍙傛暟銆?
        

娉細鍏朵腑鐢ㄦ埛鍚嶅彲鏄渷鐣ワ紝鐢ㄦ埛鍚嶅畾涔夌殑鏄▼搴忕敤鍝釜鐢ㄦ埛鏉ユ墽琛岋紝姣斿mysql鏈嶅姟鍣紝鎴戜滑鍙互瀹氫箟鎴愪互mysql鐢ㄦ埛鏉ュ惎鍔ㄣ佸仠姝€侀噸鏂板惎鍔紝榪欐椂瑕佸啓涓婄敤鎴峰悕錛涗笉榪囧浜巆ron鏉ヨ鎰忎箟涓嶆槸澶ぇ錛屽洜涓烘瘡涓敤鎴烽兘鏈夎嚜宸辯殑cron閰嶇疆鏂囦歡銆傛湁浜涚▼搴忕殑鍚姩蹇呴』鐢ㄥ埌root鐢ㄦ埛錛岃繖鏃舵垜浠氨鍙互淇敼root鐢ㄦ埛鐨刢ron閰嶇疆鏂囦歡灝辮浜嗐傚湪姣忎釜鐢ㄦ埛鐨勯厤緗枃浠朵腑錛屼笉蹇呮寚瀹氱敤鎴峰悕銆?/p>

鎴戜滑鍙互鎶婅鍒掍換鍔″啓鍦ㄥ叏灞鎬ч厤緗枃浠朵腑錛屽鏋滄偍鎯蟲妸涓涓鍒掓斁鍏ュ叏灞鎬ч厤緗枃浠朵腑錛屽氨寰楁敼鍙戣鐗堟墍瀵瑰簲鐨刢ron鍏ㄥ眬閰嶇疆鏂囦歡錛屾瘮濡侳edora 5鐨勫叏灞鎬ч厤緗枃浠舵槸/etc/crontab鏂囦歡錛?/p>

姣忎釜鐢ㄦ埛涔熻兘瀹氫箟鑷繁鐨刢ron閰嶇疆鏂囦歡錛岀敤crontab -e 鍛戒護鏉ュ畾涔夛紱

涓句竴渚嬶細璁╂満鍣ㄥ湪姣忓ぉ8鐐?0鍒嗛噸鏂板惎鍔紱

鍏充簬鏃墮棿鏍煎紡涓湁7涓瓧孌點傛垜浠彲浠ョ洿鎺ユ洿鏀規垨鑰呮坊鍔狅紝褰撶劧榪欐槸緋葷粺浠誨姟璋冪敤銆備婦涓緥瀛愶紝姣斿鎴戝湪姣忓ぉ鐨勬棭涓?鐐?0鍒嗛噸鏂板惎鍔ㄦ満鍣紝灝卞彲浠ュ湪
/etc/crontab涓姞鍏ヤ笅闈㈢殑涓ゅ彞錛岀涓鍙ュ氨鏄敞閲婁簡銆備互#鍙峰紑濮嬶紝鍚庨潰鍐欎竴涓嚜宸辮兘鐭ラ亾榪欐槸浠涔堜換鍔$殑澶囨敞錛?/p>

# reboot OS
30 8 * * * root /sbin/reboot

 

絎竴孌靛簲璇ュ畾涔夌殑鏄細鍒嗛挓錛岃〃紺烘瘡涓皬鏃剁殑絎嚑鍒嗛挓鏉ユ墽琛屻傝寖鍥存槸浠?-59
絎簩孌靛簲璇ュ畾涔夌殑鏄細灝忔椂錛岃〃紺轟粠絎嚑涓皬鏃舵潵鎵ц錛岃寖鍥存槸浠?-23
絎笁孌靛簲璇ュ畾涔夌殑鏄細鏃ユ湡錛岃〃紺轟粠姣忎釜鏈堢殑絎嚑澶╂墽琛岋紝鑼冨洿浠?-31
絎洓孌靛簲璇ュ畾涔夌殑鏄細鏈堬紝琛ㄧず姣忓勾鐨勭鍑犱釜鏈堟潵鎵ц錛岃寖鍥翠粠1-12
絎簲孌靛簲璇ュ畾涔夌殑鏄細鍛紝琛ㄧず姣忓懆鐨勭鍑犲ぉ鎵ц錛岃寖鍥翠粠0-6錛屽叾涓?0琛ㄧず鏄熸湡鏃ャ?br>姣忓叚孌靛簲璇ュ畾涔夌殑鏄細鐢ㄦ埛鍚嶏紝涔熷氨鏄墽琛岀▼搴忚閫氳繃鍝釜鐢ㄦ埛鏉ユ墽琛岋紝榪欎釜涓鑸彲浠ョ渷鐣ワ紱
絎竷孌靛簲璇ュ畾涔夌殑鏄細鎵ц鐨勫懡浠ゅ拰鍙傛暟銆?/p>

瀵規瘮涓婇潰鐨勪緥瀛愬氨鐭ラ亾錛?0鏄笉鏄垎閽燂紵錛?鏄笉鏄皬鏃訛紵濡傛灉鏈?浠h〃鐨勫湴鏂癸紝琛ㄧず鍏ㄩ儴錛屼篃灝辨槸璇達紝姣忎釜鏈堬紝姣忓ぉ錛屾瘡鏄熸湡閮借鎵ц銆俽oot 琛ㄧず鐢╮oot鐢ㄦ埛鎵ц錛屽懡浠ゆ槸/sbin/reboot 錛屼篃灝辨槸璇達紝緋葷粺鍦ㄦ瘡澶?8鐐?0鍒嗛噸鏂板惎鍔紱

鎴戜滑鍙互鎶婃瘡澶?鐐?0鍒嗛噸鏂板惎鍔ㄧ殑璁″垝浠誨姟鍐欏叆cron鍏ㄥ眬鎬ч厤緗枃浠朵腑錛屼篃鍙互瀹氫箟鍦╮oot鐢ㄦ埛鑷繁鐨刢ron閰嶇疆鏂囦歡涓傚鏋滃畾涔夊湪root鑷繁鐨勯厤緗枃浠訛紝璇風敤root韜喚鏉ユ墽琛?crontab -e 鏉ヤ慨鏀歸厤緗枃浠訛紱crontab -e 榪涘叆淇敼閰嶇疆鏂囦歡鐨勮繃紼嬶紝鍏跺疄鍜寁i鐨勭敤娉曚竴鏍鳳紝璇峰弬鐪媣i 鐨勭敤娉曪細銆婃枃浠剁紪杈戝櫒 vi銆?/font>

璁╅厤緗枃浠剁敓鏁堬細濡傛灉璁╅厤緗枃浠剁敓鏁堬紝榪樺緱閲嶆柊鍚姩cron錛屽垏璁幫紝鏃㈢劧姣忎釜鐢ㄦ埛涓嬬殑cron閰嶇疆鏂囦歡淇敼鍚庛備篃瑕侀噸鏂板惎鍔╟ron鏈嶅姟鍣ㄣ?/p>

鍦‵edora 鍜孯edhat涓紝鎴戜滑搴旇鐢紱

[root@localhost ~]# /etc/init.d/crond restart

 

濡傛灉璁ヽrond 鍦ㄥ紑鏈烘椂榪愯錛屽簲璇ユ敼鍙樺叾榪愯綰у埆錛?/p>

[root@localhost ~]# chkconfig --levels 35 crond on

 

鍦⊿lackware涓紝濡傛灉寮鏈鴻嚜鍔ㄨ繍琛岋紱

鏌ョ湅/etc/rc.d/rc.M鏂囦歡鏄惁鏈夊鐨勮錛屽鏋滄病鏈夊氨鍔犱笂錛屽ぇ澶氭槸鏈夌殑錛?/p>

# Start crond (Dillon's crond):
if [ -x /usr/sbin/crond ]; then
  /usr/sbin/crond -l10 >>/var/log/cron 2>&1
</cdoe>
<b>
濡傛灉鎯寵绔嬪嵆璁ヽron閲嶅惎鐢熸晥錛屼篃鍙互鐢ㄤ笅闈㈢殑鍔炴硶錛?br></b>
<code>
[root@localhost ~]# pgrep crond 娉細鏌ョ湅crond鏈嶅姟鍣ㄦ槸鍚﹁繍琛岋紱
2022
[root@localhost ~]# pkill crond 娉細鏉姝籧rond錛?br>[root@localhost ~]# pgrep crond 娉細鏌ョ湅crond鏄惁閫鍑猴紱
[root@localhost ~]# /usr/sbin/crond 娉細鍚姩crond錛?br>[root@localhost ~]# pgrep crond 娉細鏌ョ湅crond 鏄惁宸茬粡榪愯寰楄搗鏉ヤ簡錛?br>3883

 


2.2.3 鍏充簬鍚屼竴鏃墮棿錛屽悓鏃舵墽琛屽涓換鍔$殑瀹氫箟鏂規硶錛?br>

鎴戜滑鍦ㄥ墠闈㈠凡緇忚榪囷紝鍦ㄥ叏灞鎬ч厤緗枃浠朵腑錛屾湁綾諱技濡備笅鐨勬钀斤紱

1 * * * * root run-parts /etc/cron.hourly 娉細琛ㄧず姣忎釜灝忔椂鐨勭涓鍒嗛挓錛屽紑濮嬫墽琛?etc/hourly鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?br>2 4 * * * root run-parts /etc/cron.daily 娉細琛ㄧず姣忓ぉ鐨?鐐?鍒嗭紝寮濮嬫墽琛?etc/cron.daily鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?br>22 4 * * 7 root run-parts /etc/cron.weekly 娉細姣忓勾絎?涓懆4鐐規垜22鍒嗭紝寮濮嬫墽琛?/etc/cron.weekly鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?br>42 4 1 * * root run-parts /etc/cron.monthly 娉細姣忔湀絎?澶╃殑4鐐?2鍒嗭紝寮濮嬫墽琛?etc/cron.monthly鐩綍涓嬬殑鍙墽琛岀▼搴忔垨鑴氭湰錛?/code>

 

涓句緥鏉ヨ錛屾垜鎯沖湪姣忓ぉ5鐐?0鍒嗘潵閲嶆柊鍚姩httpd 鏈嶅姟鍣紝涓庢鍚屾椂錛屾垜浠篃鍙互鍚屾椂涓嬭澆涓涓狪SO鏂囦歡銆傚鏋滄垜浠寜涔﹀啓璁″垝浠誨姟鐨勮鍒欎竴鏉′竴鏉$殑鏉ヤ功鍐欙紝騫舵坊鍔犲埌鍏ㄥ眬鏄湁鐐歸夯鐑︺備笉濡傚啓涓涓剼鏈斁鍦?etc/crond.daily鐩綍涓傜劧鍚庢妸鍏舵潈闄愯緗負755 錛堝叧浜庢潈闄愮殑璁劇疆錛岃鍙傝冿細銆奓inux 鏂囦歡鍜岀洰褰曠殑灞炴с?/font>錛夈?/p>

褰撶劧鎴戜滑寰楁敼涓鏀逛笂闈㈢殑 甯︽湁/etc/cron.daily閭h錛屾敼涓哄涓嬶紱

10 5 * * * root run-parts /etc/cron.daily
</cdoe>
鐒跺悗鎴戜滑鍒?etc/crond.daily鐩綍涓垱寤轟袱涓枃浠訛紝涓涓槸鐢ㄦ潵閲嶅惎httpd鏈嶅姟鍣ㄧ殑錛屽涓嬶紱
<code>
[root@localhost cron.daily]# touch httpd.sh
[root@localhost cron.daily]# chmod 755 httpd.sh
[root@localhost cron.daily]# echo "/etc/init.d/httpd restart" > httpd.sh
[root@localhost cron.daily]# more httpd.sh
/etc/init.d/httpd restart

 

濡傛灉鎴戞兂鍦ㄦ瘡澶?鐐?0鍒嗕笅杞紽C5鐨勯暅鍍忥紝鍙互鍐嶅垱寤轟竴涓枃浠秄c5down.sh

[root@localhost cron.daily]# touch fc5down.sh
[root@localhost cron.daily]# chmod 755 fc5down.sh
[root@localhost cron.daily]# echo "/usr/bin/wget http://mirrors.kernel.org/fedora/core/5/i386/iso/FC-5-i386-DVD.iso" > fc5down.sh
[root@localhost cron.daily]# more fc5down.sh
/usr/bin/wget http://mirrors.kernel.org/fedora/core/5/i386/iso/FC-5-i386-DVD.iso

 

鐒跺悗鎴戜滑閲嶆柊鍚姩涓涓媍rond灝辮浜嗭紱

[root@localhost cron.daily]# pkill crond
[root@localhost cron.daily]# prep crond
[root@localhost cron.daily]# crond&

 

娉ㄦ剰錛?/strong>鎴戝彧鏄兂璇存槑涓涓嬶紝鍦ㄥ悓涓鏃墮棿 鎵ц澶氫釜璁″垝浠誨姟鐨勭畝鍗曠敤娉曪紝騫朵笉鏄湁鎰忔暀緇欐偍姣忓ぉ鏃╀笂閮戒笅杞紽C5鐨勬槧鍍忋傛垜涓捐繖涓緥瀛愭槸涓轟簡鍒濆鑰呬簡瑙h繖涓姛鑳姐傚鏋滄偍鏈夊ソ澶氱殑浠誨姟鍦ㄦ煇涓鏃跺埢鎵ц錛岄偅灝辮嚜宸卞啓鑴氭湰鏂囦歡銆傛斁鍦?etc鐩綍涓嬬殑cron.hourly 銆乧ron.daily 銆乧ron.weekly 銆乧ron.monthly 鐩綍涓傚嚒鏄斁榪涜繖浜涚洰褰曠殑鍙墽琛岃剼鏈紝閮借兘鍦ㄧ害瀹氱殑鏃墮棿鍐呭噯紜墽琛屻傛瘡涓洰褰曟湁姣忎釜鐩綍鐨勭敤閫旓紱


2.2.4 瀵逛簬鐢ㄦ埛鑷韓鐨刢ron 閰嶇疆鏂囦歡鐨勮鏄庯紱

姣忎釜鐢ㄦ埛閮芥湁鑷繁鐨刢ron閰嶇疆鏂囦歡錛岄氳繃crontab -e 灝卞彲浠ョ紪杈戯紝涓鑸殑鎯呭喌涓嬶紝鍦‵edora鍜孯edhat鐨勫彂琛岀増錛屾垜浠紪杈戝ソ鐢ㄦ埛鐨刢ron閰嶇疆鏂囦歡淇濆瓨閫鍑哄悗錛岀郴緇熶細鑷姩灝卞瓨鏀句簬/var/spool/cron/鐩綍涓紝鏂囦歡浠ョ敤鎴峰悕鍛藉悕銆傚湪Slackware涓槸浣嶄簬/var/spool/cron/crontabs/鐩綍涓傚叾瀹冪殑鍙戣鐗堥兘宸笉澶氾紝鏈夌偣綾諱技銆傝嚜宸辨壘鎵懼惂錛涙煡鐪嬬敤鎴風殑璁″垝浠誨姟鏄痗rontab -l

crontab -e 娉細緙栬緫鐢ㄦ埛鐨刢ron閰嶇疆鏂囦歡錛?br>crontab -l 娉細鏌ョ湅鐢ㄦ埛鐨勮鍒掍換鍔★紱

 

姣斿鎴戠敤beinan鐢ㄦ埛鏉ヨ繍琛宑rontab -e 錛?/p>

[beinan@localhost ~]$ id 娉細鍒ゆ柇鎵鐢ㄧ敤鎴瘋韓浠斤紱
uid=500(beinan) gid=500(beinan) groups=500(beinan)
[beinan@localhost ~]$ crontab -e 娉細緙栬緫鐢ㄦ埛beinan鐨勮鍒掍換鍔★紱

 

鎴戜滑鍦ㄩ噷闈㈠畾涔変竴涓換鍔★紱

40 20 * * * /usr/bin/wget http://mirrors.kernel.org/fedora/core/5/i386/iso/FC-5-i386-DVD.iso

 

淇濆瓨閫鍑哄悗錛屾垜浠敤涓嬮潰鐨勫懡浠ゆ潵鏌ョ湅beinan鐢ㄦ埛鐨勮鍒掍換鍔★紱

[beinan@localhost ~]$ crontab -l
40 20 * * * /usr/bin/wget http://mirrors.kernel.org/fedora/core/5/i386/iso/FC-5-i386-DVD.iso

 

閰嶇疆濂藉悗錛屾垜浠繕瑕侀噸鏂板惎鍔╟rond鏈嶅姟鍣紝姣忎釜鐢ㄦ埛cron閰嶇疆鏂囦歡鐨勬敼鍔ㄩ兘寰楅噸鏂板惎鍔╟rond鏈嶅姟鍣紱鍓嶉潰宸茬粡璇磋繃浜嗭紝榪欓噷鐪佺暐錛涘煎緱娉ㄦ剰鐨勬槸閲嶅惎crond鏈嶅姟鍣紝闇瑕乺oot鏉冮檺錛屾偍鍙互鐢╯u鍛戒護鍒囨崲鍒皉oot 鐢ㄦ埛錛岀劧鍚庡啀鏉ラ噸鍚痗rond錛?/p>


鍦‵edora鎴朢edhat絳変互RPM鍖呯鐞嗙殑鍙戣鐗堜腑錛?br>

[beinan@localhost ~]$ su
鍙d護錛?br>[root@localhost beinan]# /etc/init.d/crond restart
鍋滄 crond錛?[紜畾]
鍚姩 crond錛?[紜畾]

 


涔熷彲浠ュ厛鏉姝籧rond錛屽啀榪愯crond鍛戒護鐨勫姙娉曟潵鍚姩錛?br>

[root@localhost beinan]# pkill crond
[root@localhost beinan]# pgrep crond
[root@localhost beinan]# /usr/sbin/crond
[root@localhost beinan]# pgrep crond
6664

 


3銆佽鍒掍換鍔$殑搴旂敤鑼冨洿錛?br>

璁″垝浠誨姟涓昏鏄緋葷粺鑷姩瀹屾垚涓浜涘伐浣溿傛瘮濡傛垜浠彲浠ヨ緋葷粺鑷姩鍦ㄦ煇涓鏃跺埢娓呯悊鎴栧浠絟ttpd鏈嶅姟鍣ㄧ殑鏃ュ織錛岀劧鍚庨噸鏂板惎鍔╤ttpd鏈嶅姟鍣紝榪欏緗戠粶綆$悊鍛樻潵璇存槸寰堥噸瑕佺殑銆備篃鍙互璁╃郴緇熻嚜鍔ㄦ竻絀轟綅浜?tmp鐩綍鐨勫瀮鍦炬枃浠躲?/p>

鍙﹀鍊煎緱涓鎻愮殑鏄紝LinuxSir.Org 鏈夊緢澶氬瓙绔欙紝姣忎釜瀛愮珯閮芥湁RSS錛岃兘璁╄繖浜涚珯鐐圭殑RSS鐩鎬簰鎶曢掞紝涔熸槸鐢╟ron鏉ュ畬鎴愶紝姣斿鏄湪鏃╀笂4鐐瑰乏鍙沖紑濮嬫墽琛岃繖涓換鍔°傝繖鏄竴涓瀬涓鴻楄垂璧勬簮鐨勮繃紼嬶紝濡傛灉涓嶆槸鏀懼湪鍦ㄧ嚎浜哄皯鐨勬椂鍊欙紝鍩烘湰鏃犳硶瀹屾垚錛屾墍浠ュ彧鑳芥斁鍦ㄦ棭涓婅繘琛屻備綔涓篠IR鐨勭鐞嗗憳錛屼笉鍙兘姣忓ぉ鏃╀笂4鐐硅搗鏉ョ偣榧犳爣鏉ュ畬鎴愯繖浜涗簨鍚с傛墍浠ユ渶濂界殑鍔炴硶灝辨槸閫氳繃cron鏉ヨ嚜鍔ㄨ繍琛岋紝浠ュ湪鏈嶅姟鍣ㄦ渶娓呴棽鐨勬椂鍊欐潵瀹屾垚榪欓」宸ヤ綔錛?/p>



]]>
redhat enterprise 4 x鐨勫垎杈ㄧ巼璁劇疆楂樹簡鐨勮В鍐沖姙娉?/title><link>http://m.tkk7.com/loocky/archive/2007/07/24/131966.html</link><dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator><author>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author><pubDate>Tue, 24 Jul 2007 01:19:00 GMT</pubDate><guid>http://m.tkk7.com/loocky/archive/2007/07/24/131966.html</guid><wfw:comment>http://m.tkk7.com/loocky/comments/131966.html</wfw:comment><comments>http://m.tkk7.com/loocky/archive/2007/07/24/131966.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/loocky/comments/commentRss/131966.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/loocky/services/trackbacks/131966.html</trackback:ping><description><![CDATA[鍒嗚鯨鐜囪緗珮浜哫璧鋒潵鍚庤姳灞忥紝鏃犳硶閫氳繃X鐣岄潰鎭㈠鍥炲幓錛屽彧鑳界敤鏅氱敤鎴瘋繘鏉ュ悗錛宻u 鍒皉oot涓婃潵鎵懼埌XORG.CONF   鏂囦歡<br><br>淇敼/etc/X11/xorg.conf  <br><br>screen閲岄潰鐨勮緗渶澶х殑閭d釜鍘繪帀灝卞ソ浜嗭紝閲嶅惎灝卞彲浠ヤ簡<img src ="http://m.tkk7.com/loocky/aggbug/131966.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/loocky/" target="_blank">灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/a> 2007-07-24 09:19 <a href="http://m.tkk7.com/loocky/archive/2007/07/24/131966.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>redhat 鍏蟲満娉ㄩ攢鍛戒護璇﹁Вhttp://m.tkk7.com/loocky/archive/2007/07/17/130807.html灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/dc:creator>灝忓皬紼嬪簭紼嬪簭鍛樻販鍙iキ鍚?/author>Tue, 17 Jul 2007 05:27:00 GMThttp://m.tkk7.com/loocky/archive/2007/07/17/130807.htmlhttp://m.tkk7.com/loocky/comments/130807.htmlhttp://m.tkk7.com/loocky/archive/2007/07/17/130807.html#Feedback0http://m.tkk7.com/loocky/comments/commentRss/130807.htmlhttp://m.tkk7.com/loocky/services/trackbacks/130807.html涓銆佹敞閿錛屽叧鏈猴紝閲嶅惎

銆銆娉ㄩ攢緋葷粺鐨刲ogout鍛戒護

銆銆1錛孡ogout 娉ㄩ攢鏄櫥闄嗙殑鐩稿鎿嶄綔錛岀櫥闄嗙郴緇熷悗錛岃嫢瑕佺寮緋葷粺錛岀敤鎴峰彧瑕佺洿鎺ヤ笅杈緇ogout鍛戒護鍗沖彲:

銆銆[root@localhost root]#logout

銆銆Red Hat Linuxrelease 9(Shike)

銆銆Kernel 2.4.20.8 on an i686

銆銆Login: ← 鍥炲埌鐧婚檰鐨勭敾闈?/p>

銆銆2錛屽叧鏈烘垨閲嶆柊鍚姩鐨剆hutdown鍛戒護

銆銆Shutdown鍛戒護鍙互鍏抽棴鎵鏈夌▼搴忥紝渚濈収鐢ㄦ埛鐨勯渶瑕侊紝閲嶆柊鍚姩鎴栧叧鏈恒?/p>

銆銆鍙傛暟璇存槑濡備笅:

銆銆飦?绔嬪嵆鍏蟲満:-h 鍙傛暟璁╃郴緇熺珛鍗沖叧鏈恒傝寖渚嬪涓?

銆銆[root@localhost root]#shutdown –h now ← 瑕佹眰緋葷粺绔嬪嵆鍏蟲満

銆銆飦?鎸囧畾鍏蟲満鏃墮棿:time鍙傛暟鍙寚瀹氬叧鏈虹殑鏃墮棿;鎴栬緗涔呮椂闂村悗榪愯shutdown鍛戒護錛岃寖渚嬪涓?

銆銆[root@localhost root]#shutdown now ← 绔嬪埢鍏蟲満

銆銆[root@localhost root]#shutdown +5 ← 5鍒嗛挓鍚庡叧鏈?/p>

銆銆[root@localhost root]#shutdown 10:30 ← 鍦?0:30鏃跺叧鏈?/p>

銆銆飦?鍏蟲満鍚庤嚜鍔ㄩ噸鍚?-r 鍙傛暟璁劇疆鍏蟲満鍚庨噸鏂板惎鍔ㄣ傝寖渚嬪涓?

銆銆[root@localhost root]#shutdown -r now ← 绔嬪埢鍏抽棴緋葷粺騫墮噸鍚?/p>

銆銆[root@localhost root]#shutdown -r 23:59 ← 鎸囧畾鍦?3:59鏃墮噸鍚姩

銆銆3錛岄噸鏂板惎鍔ㄨ綆楁満鐨剅eboot鍛戒護

銆銆欏懼悕鎬濅箟錛宺eboot鍛戒護鏄敤鏉ラ噸鏂板惎鍔ㄧ郴緇熺殑銆傚父鐢ㄧ殑鍙傛暟濡備笅:

銆銆飦?-f 鍙傛暟:涓嶄緷姝e父鐨勭▼搴忚繍琛屽叧鏈猴紝鐩存帴鍏抽棴緋葷粺騫墮噸鏂板惎鍔ㄨ綆楁満銆?/p>

銆銆飦?-I 鍙傛暟:鍦ㄥ湪閲嶆柊鍚姩涔嬪墠鍏抽棴鎵鏈夌綉緇滄帴鍙c?/p>

銆銆铏界劧reboot鍛戒護鏈変釜鍙傛暟鍙互浣跨敤錛屼絾鏄竴鑸彧闇瑕佸崟鐙繍琛宺eboot鍛戒護灝卞彲浠ヤ簡



]]>
主站蜘蛛池模板: 自拍偷自拍亚洲精品偷一| 久久免费观看国产精品| 亚洲精品国产美女久久久| 18成禁人视频免费网站| 久久亚洲精品无码网站| 亚洲精品~无码抽插| 在线成人a毛片免费播放 | 亚洲中文字幕精品久久| 精品亚洲成α人无码成α在线观看 | 亚洲精品福利你懂| 久久精品国产亚洲精品| 中文毛片无遮挡高潮免费| 免费在线观看一区| 亚洲人成黄网在线观看| 亚洲毛片αv无线播放一区| 最近免费中文字幕大全| a毛看片免费观看视频| 亚洲精品精华液一区二区| 亚洲AV日韩AV高潮无码专区| 日本一道在线日本一道高清不卡免费| 日韩电影免费在线观看中文字幕| 黑人粗长大战亚洲女2021国产精品成人免费视频| 亚洲综合伊人久久大杳蕉| 在线免费一区二区| 国产成人精品免费午夜app| 国产免费福利体检区久久| 亚洲国产精品精华液| 91在线精品亚洲一区二区| 中文字幕亚洲综合久久菠萝蜜 | 成av免费大片黄在线观看| 亚洲码欧美码一区二区三区| 亚洲欧洲日产国产综合网| 精品国产香蕉伊思人在线在线亚洲一区二区 | 最近中文字幕完整版免费高清| caoporn国产精品免费| 亚洲AV无码专区在线电影成人 | 亚洲中文无码a∨在线观看| 国产日韩亚洲大尺度高清| 亚洲国产一成久久精品国产成人综合 | 直接进入免费看黄的网站| 中文字幕精品三区无码亚洲|