In Magento we can schedule custom tasks in our XML configuration, in a similar manner to the UNIX crontab style.
Like in app/code/core/Mage/CatalogRule/etc/config.xml:
<config>
<crontab>
<jobs>
<catalogrule_apply_all>
<schedule><cron_expr>0 1 * * *</cron_expr></schedule>
<run><model>catalogrule/observer::dailyCatalogUpdate</model></run>
</catalogrule_apply_all>
</jobs>
</crontab>
</config>
This example will run Mage_CatalogRule_Model_Observer::dailyCatalogUpdate method every day at 01:00am (0 1 * * *).
To execute these configured tasks, there is a cron.php file located in the Magento root and it need to be run periodically,like every 15 minutes. Basically, these script will check that if it needs to run any tasks, and if it needs to schedule any future tasks.
In UNIX/BSD/linux systems we need to add this line in our crontab:
*/10 * * * * /bin/sh /absolute/path/to/magento/cron.sh