Is there a built-in cron job functionality in Magento and what is the suggested way to use cron job (in particular for updating stock quantities of products, but this is not important here in this question)? We have a .CSV that is periodically updated and we want the cron job to take it periodically and process it, so we want to use cron and not any other way. Cron job is way we want to go, but I want to know more about cron job integration in Magento. What is the best way to do this? I added the Magento cron using this:
crontab -e and added this line there:
*/1 * * * * /bin/sh /Applications/XAMPP/htdocs/mymagento/cron.sh I also created the cron using a module, like this:
<config> ... <crontab> <jobs> <mynamespace_mymodule_test> <schedule><cron_expr>*/1 * * * *</cron_expr></schedule> <run><model>mymodule/observer::test</model></run> </mynamespace_mymodule_test> </jobs> </crontab> ... </config> I created the observer (in Mynamespace/Mymodule/Model/Observer.php) and its method like this:
class Mynamespace_Mymodule_Model_Observer { public function test(){ error_log("success!!!!!"); } } So I expect to get that message logged, but it is not. It's never logged. I can see the cron in the cron_schedule table if I run [mymagento]/cron.php in the browser, but the message is not logged. What am I missing here?