<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ![](https://img.kancloud.cn/41/e0/41e066af9a6c25a24868d9667253ec98_1241x333.jpg) ***** ## crontab的使用 安裝 ``` apt-get install cron ``` 使用 ``` crontab -e 進入編輯頁面(第一次會讓你選擇編輯器,選擇3 /usr/bin/vim.basic) 如果想修改編輯器 sudo select-editor crontab -l 查看當前的定時任務 編輯: 分 小時 日 月 星期 命令 0-59 0-23 1-13 1-12 1-7 command ``` 例子 ``` 30 7 8 * * ls 指定每月8號的7:30執行ls命令 */15 * * * * ls 每15分鐘執行一次ls命令 0 */2 * * * ls 每隔兩個小時執行一次ls ``` 注意點: - 星期中0表示周日 - 每隔兩個小時的時候前面的不能為*,為*表示每分鐘都會執行 ## crontab的使用 執行python程序: 1.先把python的執行命令寫入.sh腳本 ``` #!/bin/sh cd `dirname $0` || exit 1 python ./main.py >> run.log 2>&1 ``` 2.給.sh腳本添加可執行權限 ``` chmod +x test.sh ``` 3.把.sh程序寫入crontab配置文件中 ``` * * * * * /home/juran/test.sh >> /home/juran/run1.log 2>&1 ``` cat run.log 查看run.log里面的文件 tail -f run.log 可以查看run.log里面增加的文本內容
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看