php - Cron 作业无法使用 crontab linux

标签 php linux laravel cron

我尝试通过 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/

相关文章:

Linux Sudo 用户禁用将目录更改为/

laravel - 使用 $append 属性进行 Eloquent Eager Loading

php - 用数组验证

PHP mysqli_num_rows 条形图中每个结果? CanvasJS 和 PHP

javascript - 具有浮点值的 Html 属性 'Max' 会出现问题

c - 是否需要使用 `O_NONBLOCK` 中的 `open()` 打开与 POSIX AIO 一起使用的文件描述符?

PHP gettext 不起作用

linux - 为什么 bash 返回负数而不是 2^64?

Laravel 5.2 Eloquent 地返回软删除记录

json - 使用关系格式化 Laravel JSON 对象