是否有在php中第一个实例后1分钟运行下一个实例的选项


Is there a option to run next instance 1 minute after the first instance in php

我有一个独立的php脚本,它需要在基于joomla的服务器上运行。

在我想要的地方,脚本应该在执行后每分钟递归运行一次。

Where脚本包含php 的while循环和头函数

因此,一定要建议任何方法来完成这项任务。

尝试以下脚本在运行时设置cron。

<?phps
$output = shell_exec('crontab -l');
file_put_contents('/tmp/crontab.txt', $output.'* * * * * NEW_CRON'.PHP_EOL);
echo exec('crontab /tmp/crontab.txt');
?>