0

I'm trying to set up a small cron job example, which I have problems with.

This is my Observer Class with the method I would like to start via cron

class Mynamespace_Mymodule_Model_Observer
{

    public function startJob($observer)
    {
       Mage::log('Hello World');
    }
}

Here's the cron part in my config.xml

<crontab>
    <jobs>
        <mynamespace_start_job>
            <schedule>
                <cron_expr>*/5 * * * *</cron_expr>
            </schedule>
            <run>
                <model>mymodule/observer::startJob</model>
            </run>
        </mynamespace_start_job>
    </jobs>
</crontab>

I'm using the AOE scheduler and I setup cron.

So when I want to test my cron job and run it via AOEscheduler I get the following error message via system.log:

2015-06-04T18:01:15+00:00 ERR (3): Warning: include(Mage/Mymodule/Model/Observer.php): failed to open stream: No such file or directory  in /var/www/html/magento/lib/Varien/Autoload.php on line 94

2015-06-04T18:01:15+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Mymodule/Model/Observer.php' for inclusion (include_path='/var/www/html/magento/app/code/local:/var/www/html/magento/app/code/community:/var/www/html/magento/app/code/core:/var/www/html/magento/lib:.:/usr/share/php:/usr/share/pear')  in /var/www/html/magento/lib/Varien/Autoload.php on line 94

As you can see magento is looking for my module in Mage/ instead of Mynamespace/

How can I change it?

1

Make sure your model is in the right path and that you have declared you models folder on your config.xml file like:

<models> <mymodule> <class>mynamespace_mymodule_Model</class> </mymodule> </models>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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