开发者

How to call a URL periodically form a linux box (cron job)?

I have a shell access on a Linux box where my Website resides.

I want to call a URL each hour on that Website (it's not a specific PHP file, I have codeigniter has a framework and some Apache redirects, so I really need to call a URL).

I guess I can use wget and cron开发者_开发问答tab? How?


Add this to /etc/crontab

0 * * * * wget -O - -q -t 1 http://www.example.com/cron.php

Alternatively, create a shell script in the /etc/cron.hourly

File: wget

#!/bin/sh
wget -O - -q -t 1 http://www.example.com/cron.php

make sure you chmod +x wget (or whatever filename you picked)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜