Laravel-4.2及以上版本如何设置调度器

How to setup scheduler in Laravel-4.2 and Above version

我在 ..\app\commands\

创建了 job.php
public function fire()  {
    $this->dailyAt('09:00', function(){
    Mail::send('emails.test', array(), function($message) {
             $message->to('address', '')->subject('subject')->attach('path');
         });
    });//end daily
 }

protected function dailyAt($time, callable $callback){
    if(date('H:i', $this->timestamp) === $time) call_user_func($callback);
}

我在命令提示符下手动输入 'php artisan cron:run',它运行完美。我怎么安排这个?我知道有 * * * * * 之类的东西,但是,我不知道如何使用 * * * * *

我正在使用 Laravel-4.2

请帮忙

基本上你想创建一个 cron 作业。 您可以通过将命令添加到 crontab 中来执行此操作。 在你的项目类型 crontab -e 的根目录中, 然后添加您的命令。

/10 * * * * /usr/bin/php pathto/artisan namespace:command

在哪里 /10 * * * * 是时间(每 10 分钟启动一次),/usr/bin/php php cli 的位置,pathto/artisan namespace:command 是将要执行的命令的位置。 示例:

/10 * * * * /usr/bin/php /var/www/fooproject/artisan cron:run

更多 info , and something about cronjobs.