Update : From magento 1.9 , it’s not allowed to call cron.php directly via http. So
you could change command : curl -s -o /dev/null http://your-domain.com/cron.php

to /bin/sh/YOUR_WEBSITE_DIRECTORY/public_html/cron.sh

 

There are many Magento tutorials guiding how to set up a cron job in Magento. But I like to post this tutorial for helping others who have not found the valid way to make it works. Since from Magento 1.8, we have one more step: Edit file cron.php to ensure cron tasks has been working properly.
These steps have listed as below:

1/ You have to make sure Sitemap is enable at : System > Configuration > Catalog > Catalog > Sitemap

2/ Add sitemap first : Sitemaps are defined in Top Menu > Catalog > Google sitemap : Site

3/ From magento 1.8, you have to add new line $isShellDisabled : true

after $isShellDisabled = (stripos(PHP_OS, ‘win’) === false) ? $isShellDisabled : true;

4/Login to cpanel. Choose cron jobs and adding new cron job :
Setting command run every 5 minutes :  */5 * * * *

Command : curl -s -o /dev/null http://your-domain.com/cron.php

That’s it. It’s so easy , isn’t it ? Happy coding!!!

Resources:
http://www.magentocommerce.com/wiki/3_-_store_setup_and_management/seo/creating_google_sitemaps_for_magento_sites

http://www.magentocommerce.com/knowledge-base/entry/configuration-catalog-sitemap