linux - Cron 每分钟通过 CURL 触发 url

标签 linux curl cron

我想设置一个 CRON 任务以每分钟触发一个 URL(通过 CURL)。 这看起来很简单,我搜索并写了这个:

* * * * * curl -—silent "https://urltotrigger.com/page.php" >/dev/null 2>&1

我将其添加到 crontab -e 中并保存。但好像url没有被触发。

不明白为什么,一切似乎都是正确的?你能帮我吗?谢谢。

最佳答案

您的 cron 输入错误。如果你需要它每1分钟运行一次,它应该是这样的:

*/1 * * * * curl -—silent "https://urltotrigger.com/page.php" >/dev/null 2>&1

关于linux - Cron 每分钟通过 CURL 触发 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40339488/

相关文章:

ios - 在没有 XCode 的 Linux 中使用 Flutter

java -/bin 在 JDK 中丢失

linux - 为什么只有在按回车后才能在串行连接中接收到字符?

Python Post 调用抛出 400 Bad Request

php - Twilio 无法使用 curl php

c++ - 在 Ubuntu 上为 AIX 编译 C++ 代码?

windows - 警告 : templates not found/share/git-core/templates | fatal: Unable to find remote helper for 'https'

windows - 在没有用户登录的情况下在 Windows 启动时运行脚本

php - 每秒记录 JSON 数据的最有效方法是什么

php - Cron 作业无法打开流 : No such file or directory