我正在尝试将 php 脚本与 Crontab 的 Sleep 命令一起执行。以下是相关代码:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root HOME=/
# run-parts
* * * * * sleep 5 && root /usr/bin/php /path/to/the/php/file.php
但它根本不会执行。有什么提示吗?
从sleep 5 && root /usr..
中删除root
如果要以 root 身份运行它,正确的格式是:
* * * * * root sleep 5 && /usr/bin/php /path/to/the/php/file.php