Using Cron to Periodically Visit A Web Page

Cron can be used to periodically visit a web page.

A web page may need to be periodically visited to cause an update, for example for store stock updates of to trigger a Google Froogle file creation.

Searching the Internet it is generally indicated that wget is the command to use. I also tried using Lynx, and finally Curl. For each of the commands I checked the hit on the website using awstats, it was easier than looking at the log files.

Edit the file /etc/crontab and enter the entry for the command. I have included all three for reference.

14 16   * * *   root    /usr/bin/wget  -q  "http://www.testwebsite.co.uk"
14 16   * * *   root    /usr/bin/wget  -O - -q -t 1  "http://www.testwebsite.co.uk"
26 16   * * *   root    curl --silent --compressed "http://www.testwebsite.co.uk"
18 16   * * *   root    /usr/bin/lynx "http://www.testwebsite.co.uk"

I found references to the use of the shortened and longer versions of wget. For me neither of these was observed to work.

The command found to work for me was Curl as given below.

Shown working once a day, every day of the week at 16:26.

26 16   * * *   root    curl –silent –compressed “http://www.example.com”