tags:

views:

33

answers:

1

How to create a cron job in PHP for getting the update of modified date and time of files/folders? I am a newbie to create a cron job how to get started?

+2  A: 

The easiest way to do this is to create a simple web page on your server, and adding a cron job which consists of a curl call to the page. This way you program everything as you usually do, and you can easily test it, then automate just the call. You can add some sort of protection to this page, to avoid denial of service attacks.

Palantir
I also need to know how to setup the curl for cron job?
OM The Eternity
And what if the machine in which the script is to b fired is, windows?
OM The Eternity
This depends on many factors. Do you have admin rights on that machine? If so, install curl, and set a windows task for that. Curl is available in windows too (see official page). You can also use a cron for windows (like Z-Cron for example). Or you could set up the cron on another server, and have it call your page from there: I have many websites, but I have only one cron script which calls them all from one place (easier to maintain).
Palantir
+1 thanks for "+"tional information....
OM The Eternity