如何创建Cron作业以从Web运行脚本? [英] How to create a cron job to run script from web?

查看:52
本文介绍了如何创建Cron作业以从Web运行脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用CENTOS在服务器www.domain.com中创建了一项cron作业:

I have created a cron job in a server www.domain.com with CENTOS:

*/10 * * * * http://www.anotherdomain.com/cron/task.php

,但返回值:

/bin/sh: http://www.anotherdomain.com/cron/task.php: No such file or directory

如何使其工作?

推荐答案

 */10 * * * *  wget -q -t 5 --delete-after http://www.anotherdomain.com/cron/task.php

q =安静

t =如果出现网络问题,则重试(在这种情况下为5)

t = retries incase of network issues (5 in this case)

删除后=我们不强制要求远程页面的输出

delete-after = we don't actully want the output of the remote page

这篇关于如何创建Cron作业以从Web运行脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆