Skip to main content
2 of 2
Add missing text
olcha
  • 141
  • 4
  • For clean log, shell script already exist in path-to-magento/shell directory:

    php log.php 
     Usage:  php -f log.php -- [options]
             php -f log.php -- clean --days 1
    
       clean             Clean Logs
       --days      Save log, days. (Minimum 1 day, if defined - ignoring system value)
       status            Display statistics per log tables
       help              This help
  • For clean cache, following methods will help you to make a shell script:

     // Clean js and css
     Mage::getModel('core/design_package')->cleanMergedJsCss();
     Mage::dispatchEvent('clean_media_cache_after');
    
     // product image
     Mage::getModel('catalog/product_image')->clearCache();
     Mage::dispatchEvent('clean_catalog_images_cache_after');
    
     // Get cache types
     Mage::app()->getCacheInstance()->getTypes()
    
     // Clean specific tags
     Mage::app()->cleanCache($tags);
    
     // dispatch event if you flush all cache tags
     Mage::app()->cleanCache($alltags);
     Mage::dispatchEvent('adminhtml_cache_flush_system');
     
olcha
  • 141
  • 4