•  · 5 friends

How to use Cron jobs

How to create cron jobs functions..

💓0 😆0 😲0 😥0 😠0 0
  • 145
  • More
Replies (9)
    • Hello saravanan 

      First of all, you need to have your own Cron class which will be the child of the BxDolCron class, and have the processing method. This method is responsible for the execution of your code during the call. Then you add your Cron Jobs object to the `sys_cron_jobs` table like:

      INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES

      ('name of your operation', 'time of your operation in Cron Jobs fromat like */10 * * * *','name of your class', 'name of your class file with the path', 'name of the service method which will be called too');

      You may see the default examples like

      INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES

      ('pruning', '0 0 * * *', 'BxDolCronPruning', 'inc/classes/BxDolCronPruning.php', ''),

      ('sys_acl', '0 0 * * *', 'BxDolCronAcl', 'inc/classes/BxDolCronAcl.php', ''),

      ('sys_account', '0 0 * * *', 'BxDolCronAccount', 'inc/classes/BxDolCronAccount.php', '');

      💓0 😆0 😲0 😥0 😠0 0
      • Thank you so much sir..

        💓0 😆0 😲0 😥0 😠0 0
        • Sir.., we have inserted one new cron work in sys_cron_jobs table .i have run Manually cron file.Its Working.But the Cron is not working.Please suggest..

          💓0 😆0 😲0 😥0 😠0 0
          • You need to show us what you have in this MySQL record and the content of your Cron Jobs class.

            💓0 😆0 😲0 😥0 😠0 0
            • Sir.., I have attached the screenshot sys_cron_jobs DB Table & Coding file below.Please check & help..


              💓0 😆0 😲0 😥0 😠0 0
              • May you please check does this method run? You may do it with our BxDolLog class. Just add the following code at the body of your processing method:

                $oLog = BxDolLog::getInstance();

                $oLog->setName('test');

                $oLog->write('run!');

                The test.log file should be created in the logs folder.

                💓0 😆0 😲0 😥0 😠0 0
                • I have inserted in that coding.but not reflect anything in test.log file.

                  💓0 😆0 😲0 😥0 😠0 0
                  • Plz provide me the requested in the Messenger details and pkz don't duplicate similar posts.

                    💓0 😆0 😲0 😥0 😠0 0
                    • Now i cleared the cache in dashboard .Now working Fine sir..Really Thank you so much for your help sir..

                      💓0 😆0 😲0 😥0 😠0 0
                      Not logged in users can't 'Comments Post'.
                      6
                      4
                      Added:
                      Category:

                      UNA - Network Infrastructure for Communities

                      Close