I wanted to setup a cron job inside my module. I followed the instructions on Magento wiki - how_to_setup_a_cron_job, but my cron job is simply not executing.
This is my config.xml (app/code/local/Roomstory/Invoice/etc/config.xml)
<?xml version="1.0"?>
<config>
<modules>
<Roomstory_Invoice>
<version>0.1.1</version>
</Roomstory_Invoice>
</modules>
<!-- -->
<crontab>
<jobs>
<roomstoryinvoice_setstatus>
<schedule><cron_expr>*/10 * * * *</cron_expr></schedule>
<run><model>roomstory_invoice/setstatus::run</model></run>
</roomstoryinvoice_setstatus>
</jobs>
</crontab>
</config>
And this is my class. (app/code/local/Roomstory/Invoice/Model/Setstatus.php)
<?php
class Roomstory_Invoice_Model_Setstatus {
public function run() {
return true;
}
}
?>
I have installed a Cron Scheduler Module, which shows my cron job listed, but when I try to "run now" (for debugging), I get error -
Invalid callback: roomstory_invoice/setstatus::run does not exist
This something simple, after much trying, I am still not able to find the error. Please tell some other way to do it, or indicate the error in this code.
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…