Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试与来自 Crontab 的 Sleep 命令一起执行 php 脚本。以下是相关代码:
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
但它根本不会执行。有什么提示吗?
root从中删除sleep 5 && root /usr..
root
sleep 5 && root /usr..
如果你想以 root 身份运行它,正确的格式是:
* * * * * root sleep 5 && /usr/bin/php /path/to/the/php/file.php