I want realise a cron job for import product in Magento. The code to insert the product into a php file saved in app/code/local/Test/Import/Model.

I saved config.xml in app/code/local/Test/Import/etc. I added module in app/etc/modules.

config.php contains following code:


                    <cron_expr>*/1 * * * *</cron_expr>

The folder app/code/local/Test/Import/controllers is empty.

I tried to run this cron job through url but the result is '404 PAGE NOT FOUND'.

In Magento panel control this module is not inserted in modules list in System/Configuration/Advanced.

Can you help me, please? Thank you very much!

1 Answer 1


you cannot run cron jobs directly from browser. You should create controller:

class Test_Import_IndexController extends Mage_Core_Controller_Front_Action
     public function indexAction()

and add router to <config> section of config.xml file


Next you can run from your browser

  • Thank you very much!! Can I ask you why do i have to call the function getModel('importcron/observer')->importProduct() in the controller class? many thanks!
    – Federica
    Commented Aug 26, 2016 at 14:31
  • Cron jobs are running on schedule. If you do not want to wait scheduled time, and you want to run cron job right now, you have to open specific url in browser ( for our example ). Corresponding to this url Test_Import_IndexController and indexAction start cron job importcron/observer::importProduct with next syntax Mage::getModel('importcron/observer')->importProduct();
    – Neklo.com
    Commented Sep 9, 2016 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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