Skip to main content
Fixed typo and cronjob expression. 0 1 * * * is 1 a.m., fixed it to 0 0 * * * (midnight)
Source Link
<crontab>
    <jobs>
        <clean_cache_midnight><!-- identifier -->
             <schedule>
                 <cron_expr>0 10 * * *</cron_expr> <!-- run cronjob on midnight -->
             </schedule>
            <run>
                <model>MyModule_Model_Group_Class_Name::functionName</model>
            </run>
        </clean_cache_midnight>
    </jobs>
</crontab>
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Amit_Cleancache>
        <version>1.0.0</version>
    </Amit_Cleancache>
</modules>
    <global>
        <models>
            <cleancache>
                <class>Amit_Cleancache_Model</class>
            </cleancache>
        </models>
    </global>
    <crontab>
        <jobs>
            <clean_cache_midnight><!-- identifier -->
                 <schedule>
                     <cron_expr>0 10 * * *</cron_expr> <!-- runignrunning cronjob on midnight -->
                 </schedule>
                <run>
                    <model>cleancache/Fire::fireCacheonMidnight</model>
                </run>
            </clean_cache_midnight>
        </jobs>
    </crontab>
</config>
<crontab>
    <jobs>
        <clean_cache_midnight><!-- identifier -->
             <schedule>
                 <cron_expr>0 1 * * *</cron_expr> <!-- run cronjob on midnight -->
             </schedule>
            <run>
                <model>MyModule_Model_Group_Class_Name::functionName</model>
            </run>
        </clean_cache_midnight>
    </jobs>
</crontab>
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Amit_Cleancache>
        <version>1.0.0</version>
    </Amit_Cleancache>
</modules>
    <global>
        <models>
            <cleancache>
                <class>Amit_Cleancache_Model</class>
            </cleancache>
        </models>
    </global>
    <crontab>
        <jobs>
            <clean_cache_midnight><!-- identifier -->
                 <schedule>
                     <cron_expr>0 1 * * *</cron_expr> <!-- runign cronjob on midnight -->
                 </schedule>
                <run>
                    <model>cleancache/Fire::fireCacheonMidnight</model>
                </run>
            </clean_cache_midnight>
        </jobs>
    </crontab>
</config>
<crontab>
    <jobs>
        <clean_cache_midnight><!-- identifier -->
             <schedule>
                 <cron_expr>0 0 * * *</cron_expr> <!-- run cronjob on midnight -->
             </schedule>
            <run>
                <model>MyModule_Model_Group_Class_Name::functionName</model>
            </run>
        </clean_cache_midnight>
    </jobs>
</crontab>
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Amit_Cleancache>
        <version>1.0.0</version>
    </Amit_Cleancache>
</modules>
    <global>
        <models>
            <cleancache>
                <class>Amit_Cleancache_Model</class>
            </cleancache>
        </models>
    </global>
    <crontab>
        <jobs>
            <clean_cache_midnight><!-- identifier -->
                 <schedule>
                     <cron_expr>0 0 * * *</cron_expr> <!-- running cronjob on midnight -->
                 </schedule>
                <run>
                    <model>cleancache/Fire::fireCacheonMidnight</model>
                </run>
            </clean_cache_midnight>
        </jobs>
    </crontab>
</config>
added 2 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Amit_Cleancache>
        <version>1.0.0</version>
    </Amit_Cleancache>
</modules>
    <global>
        <models>
            <cleancache>
                <class>Amit_Cleancache_Model</class>
            <cleancache></cleancache>
        <models></models>
    </global>
    <crontab>
        <jobs>
            <clean_cache_midnight><!-- identifier -->
                 <schedule>
                     <cron_expr>0 1 * * *</cron_expr> <!-- runign cronjob on midnight -->
                 </schedule>
                <run>
                    <model>cleancache/Fire::fireCacheonMidnight</model>
                </run>
            </clean_cache_midnight>
        </jobs>
    </crontab>
</config>
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Amit_Cleancache>
        <version>1.0.0</version>
    </Amit_Cleancache>
</modules>
    <global>
        <models>
            <cleancache>
                <class>Amit_Cleancache_Model</class>
            <cleancache>
        <models>
    </global>
    <crontab>
        <jobs>
            <clean_cache_midnight><!-- identifier -->
                 <schedule>
                     <cron_expr>0 1 * * *</cron_expr> <!-- runign cronjob on midnight -->
                 </schedule>
                <run>
                    <model>cleancache/Fire::fireCacheonMidnight</model>
                </run>
            </clean_cache_midnight>
        </jobs>
    </crontab>
</config>
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
    <Amit_Cleancache>
        <version>1.0.0</version>
    </Amit_Cleancache>
</modules>
    <global>
        <models>
            <cleancache>
                <class>Amit_Cleancache_Model</class>
            </cleancache>
        </models>
    </global>
    <crontab>
        <jobs>
            <clean_cache_midnight><!-- identifier -->
                 <schedule>
                     <cron_expr>0 1 * * *</cron_expr> <!-- runign cronjob on midnight -->
                 </schedule>
                <run>
                    <model>cleancache/Fire::fireCacheonMidnight</model>
                </run>
            </clean_cache_midnight>
        </jobs>
    </crontab>
</config>
added 5 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

If you in your magento system,magento cron jobs are working properly then you define a cronjob which fire on midnight and clear cache.

If you magento system,magento cron jobs are working properly then you define a cronjob which fire on midnight and clear cache.

If in your magento system,magento cron jobs are working properly then you define a cronjob which fire on midnight and clear cache.

added 1012 characters in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239
Loading
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239
Loading