我尝试通过 cron 作业运行我的 laravel 命令。但是当我在添加 cron 选项卡后使用 crontab 将我的 laravel 命令放入 cron 作业时,我没有看到 cron 作业的工作,因为我的数据库没有更新。下面是我的 cron tab 文件
# 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
帮助解决这个问题
最佳答案
我认为应该是:
* * * * * php /home/isnap/test/api/local/artisan command:trending_posts_view && /tmp/myscript.sh
(local 和 artisan 之间的空格替换为斜线)
关于php - Cron 作业无法使用 crontab linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47882808/