Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Need your help.

I need to run the CRON jobs on my local host as i am fetching feeds using RSS feeder. Please suggest how this can be achieved.

Thanks for your help.

share|improve this question

migrated from Nov 27 '10 at 19:27

This question came from our site for professional and enthusiast programmers.

Take a look to this simple manual. This explains you how Cron works and how to add tasks to your crontab.


Asuming you are on GNU/Linux, edit your crontab:

$ crontab -e

And add at the end the following line to execute it every minute:

*/1 * * * * /usr/local/bin/php -q /route/to/your/script.php

Make sure that your php executable is in /usr/local/bin

share|improve this answer
thanks for your reply. – gourav Nov 27 '10 at 16:48
Actually i need to run the CRON from my LOCALHOST. Please suggest how to achieve this. – gourav Nov 27 '10 at 16:49
'crontab -e' will open the cron list for your username on your host. Assuming this is a Linux question. – Sairam Nov 27 '10 at 17:09

If you can try to divide your problem into two, it might be easier to solve for you:
-Writing a script which fetches the rss feed and does whatever you want it to do
-Scheduling the run of that script using a cron job.

These two parts are usually independent of each other.

Are you already done with the first part? Do you have a script which can do the fetching?

If it is ready already. What type of script is it? Perl,python, something else?

UPDATE: So you want to call a PHP script on a schedule using cron jobs.

You'll probably get permission errors in your first tries, so chmod your php script to 0755.

Open up your terminal and try the code examples here.

Once you find a working command the first part is complete.

Now with the easy part.
Type crontab -e
Press insert

Let's say within the above examples the "wget" worked for you, then type in:
*/5 * * * * wget

In my terminal, I need to press esc-shift and press z two times to close the crontab. If it works for you too great. You will get one line output saying crontab installed. Job done. Every five minutes your php script will work.

share|improve this answer
thansk for your reply... – gourav Nov 27 '10 at 17:07
i am done with the first part. need to Job schedule (CRON) to be done on my local Host. i was using PHP and MySQL. Please suggest how to go about – gourav Nov 27 '10 at 17:09

if you're working on a Windows environment, the easiest way to achieve this would be to set up a scheduled task to execute the PHP script that will fetch your RSS data (using the php executable - see here)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.