How to call url periodically from linux window (cron job)?

I have access to the shell in the Linux box where my site is located.

I want to name the URL every hour on this website (this is not a specific PHP file, I have a codeigniter, there is a framework and some Apache redirects, so I really need to call the URL).

Think I can use wget and crontab? How?

+5
source share
1 answer

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 directory

File: wget

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

make sure you chmod + x wget (or any other file name you select)

+17
source

All Articles