久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      你知道linux下crontab中的%有啥特殊意義嗎?

      下面由linux系統(tǒng)教程欄目給大家介紹linux下crontab中%的使用,及其特殊含義,希望對(duì)需要的朋友有所幫助!

      你知道linux下crontab中的%有啥特殊意義嗎?

      linux下crontab中%的使用

      crontab中下面的腳本不能

       0 1 * * *   (cd /u01/prod; rsync -avz app 192.168.0.192:/u01/prod/) &>/home/applprod/backuplog/rsync_`date +%Y%m%d_%H%M%S`.log

      執(zhí)行的時(shí)候,/var/log/messages日志中顯示:

      Sep 22 22:50:01 ebsapp CROND[13389]: (applprod) CMD ((cd /u01/prod; rsync -avz app 192.168.0.192:/u01/prod/) &>/home/applprod/backuplog/rsync_`date +)

      好像是命令被截?cái)嗟臉幼印?/p>

      于是我把要執(zhí)行的命令都封裝到一個(gè)腳本中,放到crontab中執(zhí)行。

      但是稍后查看crontab的manpage時(shí)發(fā)現(xiàn),%在crontab中有特殊含義:

      The  "sixth"  field (the rest of the line) specifies the command to be run.  The entire command portion of the line, up to a new-        line or % character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile.   Percent-signs        (%)  in  the  command, unless escaped with backslash (), will be changed into newline characters, and all data after the first %        will be sent to the command as standard input.

      到這里問題已經(jīng)清楚了,并不是crontab命令被截?cái)啵潜焕斫獬闪硗獾暮x了,解決的方法也有了,就是將%進(jìn)行轉(zhuǎn)義,修改之后的腳本變成了:

      03 23 * * * (cd /u01/prod; rsync -avz app 192.168.0.192:/u01/prod/) &>/home/applprod/backuplog/rsync_`date +%Y%m%d_%H%M%S`.log

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)