How i magento perform schedule update programmatically.
- which module i check, how magento perform schedule update ?
- please narrate which file work ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityMagento manage its schedule joob via cronjob.
If you will create a custom module and define that your code will run in the schedule then you need to add your code to Magento cron job
Please follow the below article for how you can define a custom cronjob for the requirement:
https://devdocs.magento.com/guides/v2.3/config-guide/cron/custom-cron-ref.html
https://www.mageplaza.com/devdocs/magento-2-create-cron-job/#create-crontabxml
https://magefan.com/blog/create-custom-cron-job-in-magento-2
https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html
See below example:
<?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="vendorname_modulename_cron_somecronmodel" instance="VendorName\ModuleName\Cron\Cronfile" method="execute">
<schedule>* * * * *</schedule>
</job>
</group>
</config>
As per our requirement, you need to write your product update code to VendorName\ModuleName\Cron\Cronfile.php