Magento Forum

   
cron job
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

hello, anybody has does this yet ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

hi @ron, can you do it at magento ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

hi @ron, can you do it at magento ? thanks for your quick reply

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

@alkarim: do you have ssh shell? if not, which control panel do you have?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

yes, I have ssh shell, what should I must to do ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

@alkarim:

crontab -e

what do you have in there?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

thanks for your reply

yeah, means that magento support kind of crontab job.

and now I’m gonna using it so is there any solution using magento not ssh shell ??

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

@alkarim: Magento is a userland application. it has no way to run itself periodically without external spawning, be it system crontab or just having http://yourserver.com/magento/cron.php as a home page in your laptop browser.

as soon as you will follow the article you’ve linked in your original post, Magento will manage it’s own tasks whenever it needs to.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

Ok thanks, but there is still one more problem here,

I’ve made a new module and now when I call Mage::getBlockSingleton(’NAMESPACE/MODULE’) , I got no respon,

when I traced it, the its function call MAGE, not my NAMESPACE,

any idea ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

i don’t think there’s such thing as Mage::getBlockSingleton… other than that, it might be missing/incorrect configuration in your module’s etc/config.xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

so , what should I code to get all the products name ?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

$collection Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('name');

$names = array();
foreach (
$collection as $product{
  $names[] 
$product->getName();
}
print_r
($names);

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

thanks for your code, but I got this :

Fatal errorCall to a member function getModelInstance() on a non-object in /home/alkarim/vm/app/Mage.php on line 294

I think there is something to trigger it out at first time, when I try

Mage::run();
Mage::getBlockSingleton('catalog/category_view')->SOMETHING();

it works, but when I removed run(); I got another error…

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

I think this code will help you

<?php

require_once 'app/Mage.php';

umask(0);

Varien_Profiler::start('app');
Varien_Profiler::start('app::init');
Mage::app('''store', array());
Varien_Profiler::stop('app::init');
Varien_Profiler::start('app::dispatch');
Mage::app()->getFrontController()->cronDispatch();
echo 
Mage::getBlockSingleton('catalog/category_view')->Moduel();
Varien_Profiler::stop('app::dispatch');
Varien_Profiler::stop('app');

?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
alkarim
Guru
 
Total Posts:  368
Joined:  2008-04-10
 

hi there

<config>
...
    <
crontab>
        <
jobs>
            <
catalogrule_apply_all>
                <
schedule><cron_expr>0 1 * * *</cron_expr></schedule>
                <
run><model>catalogrule/observer::dailyCatalogUpdate</model></run>
            </
catalogrule_apply_all>
        </
jobs>
...
    </
crontab>
...
</
config>

what is this code does ? Is it making a cron job ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top