Ok so this has been driving me crazy for the last 4 hours. I am trying to run a cronjob on Magento. Here is my relevant directory structure:
|app
|code
|local
|MOST
|Wallet
|etc
|config.xml
|Model
|Cron.php
As well as my config.xml
<?xml version="1.0"?>
<config>
<modules>
<MOST_Wallet>
<version>0.1.0</version>
</MOST_Wallet>
</modules>
<global>
<helpers>
<wallet>
<class>MOST_Wallet_Helper</class>
</wallet>
</helpers>
<models>
<wallet>
<class>MOST_Wallet_Model</class>
</wallet>
</models>
</global>
<crontab>
<jobs>
<most_wallet>
<schedule>
<cron_expr>* * * * *</cron_expr>
</schedule>
<run>
<model>MOST_Wallet/cron::updateWallet</model>
</run>
</most_wallet>
</jobs>
</crontab>
</config>
The file Cron.php exists and has the method updateWallet in it, checked for typos :)
The cron is not enabled but that is not relevant because right now I am trying to make cron.php execute my script manualy by opening it directly. That method for testing works because all the other cron tasks seem to be working fine.
Now, the cron job fails. After a bit of searching I found out the error that is being thrown.
Warning: include(Mage/MOST/Wallet/Model/Cron.php): failed to open stream: No such file or directory in /var/www/magento_test/lib/Varien/Autoload.php on line 93
As you guys can see for some reason Magento tries to load my Cron class from the Mage folder instead of from the local folder. This causes the Cron Observer to throw an "Invalid callback" exception.
If anyone has an idea what might be causing this I would be greatful.
Edit:
As Dushyant Joshi said the config should be:
<config>
---
<crontab>
<jobs>
<most_wallet>
<schedule>
<cron_expr>* * * * *</cron_expr>
</schedule>
<run>
<model>wallet/cron::updateWallet</model><!-- change here -->
</run>
</most_wallet>
</jobs>
</crontab>
The error was also a typo in the name of the class MOST_Wallet_Model_Cron. Typos do make the worst errors after all.
Cheers.