简体   繁体   English

在Crontab CentOS中使用Sleep命令

[英]Using Sleep command in Crontab CentOS

I am trying to execute a php script in conjunction with the Sleep command from Crontab. 我试图结合Crontab的Sleep命令执行php脚本。 Here is the relevant code: 以下是相关代码:

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

But it won't execute at all. 但是它根本不会执行。 Any hints? 有什么提示吗?

Remove root from sleep 5 && root /usr.. sleep 5 && root /usr..删除root sleep 5 && root /usr..

If you want to run it as root, the correct format is: 如果要以root用户身份运行,则正确的格式为:

* * * * * root sleep 5 && /usr/bin/php /path/to/the/php/file.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM