0

I have created a Module, Now I wanted that module or controller to run daily once.

I have created below Code.

\app\code\Autosynch\synchProduct\etc\crontab.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="custom_AutoSynch_cronjob" instance="Autosynch\synchProduct\Cron\Test" method="execute">
            <schedule>*/5 * * * *</schedule>
        </job>
    </group>
</config>

How can I start cron job Manually ?

where can I check that this job is working and can I write any success or error messages ?

0

You can manage it by magento2-module-cron-schedule module.

magento2-module-cron-schedule

Shows a new Adminhtml menu entry System > Cronjob > View Cronjob Configuration.

  • I have installed this extension. and ran the php bin/magento cron:run but my schedule says it missed. – JB Pakalapati Jun 4 '18 at 5:58
  • @JBPakalapati check admin configuration of that module and configure it. – Nikunj Vadariya Jun 4 '18 at 5:59
  • I have posted another question can, you please check this – JB Pakalapati Jun 4 '18 at 6:19
0

You can run CRON by this command: php bin/magento cron:run by terminal or cmd. Even you can configure CRON in server by ssh using crontab -e command. Maybe you will need root user of server you can learn about Magento 2 CRON configuration from here : Magento 2 cron. You can check CRON successful run or not from cron_schedule database table. You can check CRON status by this command on the server : sudo service cron status.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.