【发布时间】:2017-08-27 12:45:19
【问题描述】:
我使用 curl 创建了一些 cron 作业:
curl -s https://ex.example.com/cron/test1.php
curl -s https://ex.example.com/cron/test2.php
curl -s https://ex.example.com/cron/test3.php
curl -s https://ex.example.com/cron/test4.php
现在我想使用 PHP 删除单个 cron 作业:
curl -s https://ex.example.com/cron/test3.php
我该怎么做?
【问题讨论】:
-
到目前为止您尝试过什么?在 PHP 中删除 cron 作业的方法取决于系统中 cron 作业的设置方式。
-
我已经使用这段代码添加了新的 cron exec('echo -e "
crontab -l\n curl -s ex.example.com/cron/test3.php " | crontab -', $output);我只想删除一个 -
您的链接无法访问,至少对我来说是这样。 Stack Overflow 上的良好做法是将代码粘贴到问题本身并格式化。
-
另外,你的帖子应该有一个清晰简洁的问题。