Need to inject in your construct \Magento\Quote\Model\QuoteFactory
<?php
namespace RH\Helloworld\Cron;
class CustomCronQuote
{
protected $quoteFactory;
public function __construct(
\Magento\Quote\Model\QuoteFactory $quoteFactory
) {
$this->quoteFactory = $quoteFactory;
}
public function execute()
{
$quote = $this->quoteFactory->create()->getCollection()->addFieldToFilter('customer_id',1); // pass your customer id
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/Rohan.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
$logger->info(print_r($quote->getData(),true));
}
}
Checked Magento Version : 2.4.2