我尝试通过cron job运行我的laravel命令。但是当我在添加cron选项卡后使用crontab将我的laravel命令放入cron作业时,我没有看到在cron作业上工作,因为我的数据库没有更新。下面是我的cron标签文件
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bi$
SHELL=/bin/bash
MAILTP=isnap@gmail.com
* * * * * php /home/isnap/test/api/local artisan command:trending_posts_view && /tmp/myscript.sh
帮助解决此问题
答案 0 :(得分:2)
我认为应该是:
* * * * * php /home/isnap/test/api/local/artisan command:trending_posts_view && /tmp/myscript.sh
(本地和工匠之间的空间用斜线替换)