I want to create a cron job which update product price which are disabled and the cron run at a specific time 1 time in a day.
I have created a custom basic module from taking reference from https://www.mageplaza.com/devdocs/magento-2-create-cron-job/
My crontab.xml (path : app/code/Product/Cron/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 instance="Product\Cron\Cron\Test" method="execute" name="mageplaza_helloworld_cron">
<schedule>*/1 * * * *</schedule>
</job>
</group>
</config>
my test.php is
<?php
namespace Cron\Run\Cron; (path : app/code/Product/Cron/Cron/Test.php )
class Test
{
public function execute()
{
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/cron.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info(__METHOD__);
return $this;
}
}
But it does't show me message in cron.log file. What am i missing any help is appreciated.