<i id='xHFNJ'><tr id='xHFNJ'><dt id='xHFNJ'><q id='xHFNJ'><span id='xHFNJ'><b id='xHFNJ'><form id='xHFNJ'><ins id='xHFNJ'></ins><ul id='xHFNJ'></ul><sub id='xHFNJ'></sub></form><legend id='xHFNJ'></legend><bdo id='xHFNJ'><pre id='xHFNJ'><center id='xHFNJ'></center></pre></bdo></b><th id='xHFNJ'></th></span></q></dt></tr></i><div id='xHFNJ'><tfoot id='xHFNJ'></tfoot><dl id='xHFNJ'><fieldset id='xHFNJ'></fieldset></dl></div>
    <legend id='xHFNJ'><style id='xHFNJ'><dir id='xHFNJ'><q id='xHFNJ'></q></dir></style></legend>

    <small id='xHFNJ'></small><noframes id='xHFNJ'>

  • <tfoot id='xHFNJ'></tfoot>

    • <bdo id='xHFNJ'></bdo><ul id='xHFNJ'></ul>

        Laravel 中的 Cron 作业

        Cron Job in Laravel(Laravel 中的 Cron 作业)
            <tbody id='BU8aZ'></tbody>
          1. <legend id='BU8aZ'><style id='BU8aZ'><dir id='BU8aZ'><q id='BU8aZ'></q></dir></style></legend>

          2. <i id='BU8aZ'><tr id='BU8aZ'><dt id='BU8aZ'><q id='BU8aZ'><span id='BU8aZ'><b id='BU8aZ'><form id='BU8aZ'><ins id='BU8aZ'></ins><ul id='BU8aZ'></ul><sub id='BU8aZ'></sub></form><legend id='BU8aZ'></legend><bdo id='BU8aZ'><pre id='BU8aZ'><center id='BU8aZ'></center></pre></bdo></b><th id='BU8aZ'></th></span></q></dt></tr></i><div id='BU8aZ'><tfoot id='BU8aZ'></tfoot><dl id='BU8aZ'><fieldset id='BU8aZ'></fieldset></dl></div>

              1. <tfoot id='BU8aZ'></tfoot>
                  <bdo id='BU8aZ'></bdo><ul id='BU8aZ'></ul>

                  <small id='BU8aZ'></small><noframes id='BU8aZ'>

                  本文介绍了Laravel 中的 Cron 作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试为我已经创建的命令开发一个 cron 作业.我对 cron 工作完全陌生,所以我真的不知道它是如何工作的.

                  I am trying to develop a cron job for a command I have already created. I am completely new to cron jobs so I dont really know how it works.

                  在控制台中自己尝试该命令效果很好.我所需要的只是能够每 24 小时执行一次.我正在使用 Laravel 4,有人可以帮忙吗?

                  Trying the command by myself in the console works perfectly. All I need is to be able to execute it every 24 hours. I am using Laravel 4, can anyone help?

                  谢谢!

                  推荐答案

                  要以 root 身份创建 cron 作业,请编辑您的 cron 文件:

                  To create a cron job as root, edit your cron file:

                  [sudo] crontab -e
                  

                  在最后添加一个新行,每一行都是一个cron作业:

                  Add a new line at the end, every line is a cron job:

                  25 10 * * * php /var/www/<siteName>/artisan <command:name> <parameters>
                  

                  这将在每天上午 10:25 执行相同的命令.

                  This will execute the same command at 10:25AM everyday.

                  只要确保在最后一行之后保留一个空行.您可能还需要使用 php 客户端的完整路径:

                  Just make sure you keep a blank line after the last one. And you also might need to use the full path of your php client:

                  25 10 * * * /usr/local/bin/php /var/www/<siteName>/artisan <command:name> <parameters>
                  

                  这篇关于Laravel 中的 Cron 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                    <bdo id='4uh6n'></bdo><ul id='4uh6n'></ul>
                  • <i id='4uh6n'><tr id='4uh6n'><dt id='4uh6n'><q id='4uh6n'><span id='4uh6n'><b id='4uh6n'><form id='4uh6n'><ins id='4uh6n'></ins><ul id='4uh6n'></ul><sub id='4uh6n'></sub></form><legend id='4uh6n'></legend><bdo id='4uh6n'><pre id='4uh6n'><center id='4uh6n'></center></pre></bdo></b><th id='4uh6n'></th></span></q></dt></tr></i><div id='4uh6n'><tfoot id='4uh6n'></tfoot><dl id='4uh6n'><fieldset id='4uh6n'></fieldset></dl></div>

                      <tbody id='4uh6n'></tbody>

                    1. <legend id='4uh6n'><style id='4uh6n'><dir id='4uh6n'><q id='4uh6n'></q></dir></style></legend>

                          <tfoot id='4uh6n'></tfoot>

                            <small id='4uh6n'></small><noframes id='4uh6n'>