dongrong3171 2019-02-27 20:54
浏览 64

Laravel cronjob日程表命令没有开始生产

I have 7 different schedule commands on kernel.php and one of those is not firing when running the schedule.

kernel.php
....
$schedule->command('my:command')->hourlyAt(15); // this wont run
...

Running php artisan my:command manually on command line works fine.

Also when running the scheduler on our dev server, all commands works fine. The problem is only on production server.

There are no errors on log files.

Any ideas what might be wrong?

I'm using Laravel 5.6


UPDATED: The problem was wrong artisan path on laravel forge scheduler

  • 写回答

1条回答 默认 最新

  • dongwen3093 2019-02-28 12:18
    关注

    Have you add following cron entry as per your project folder path ?

    * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
    

    please check with following commands

    crontab -l
    

    If not ?

    open crontab by

    crontab -e
    

    add * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1 entry at the end of file

    save file and run following commands

    sudo service cron restart
    

    again check with crontab -l

    this command will return already set cronjob

    i hope it helps :)

    评论

报告相同问题?

悬赏问题

  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名