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.
我需要 php 中的代码来定期检查服务器上的文件夹是否有任何文件,以便我可以开始对文件进行一些操作。有人可以给我一些提示和初学者在哪里查看如何实现这一目标。
谢谢
为此设置 cron 作业,例如:
#shell$ crontab -e */2 * * * * /usr/bin/php -f /path/to/your/script.php
上面的行将导致脚本每两分钟运行一次。
您可以在此处或在wiki 、google 上阅读更多关于 cron的信息或阅读您机器上的手册页