How to setup a cron job in Magento module?

deannaradical

New Member
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)\[code\]<?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>\[/code\]And this is my class. (app/code/local/Roomstory/Invoice/Model/Setstatus.php)\[code\]<?phpclass Roomstory_Invoice_Model_Setstatus { public function run() { return true; }}?>\[/code\]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 -\[quote\] Invalid callback: roomstory_invoice/setstatus::run does not exist\[/quote\]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!
 
Back
Top