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)
精彩评论