0

I have created a module for collecting customer data from the Magento database and sending them as a CSV file to another server by hitting the controller URL in browser.

Now, I want it to be send automatically so that I want to set a CRON job.

So in order to create the CRON job, I have referred the below tutorial:

https://www.mageplaza.com/devdocs/magento-2-create-cron-job/

However, when I run the cron, the file is not being send to another server. But, when I check the log file, I can see the CRON was ran successfully.

I'm not sure what am I missing. Could anyone please guide me?

Your help will be appreciated!

| improve this question | | | | |
  • Please add your logic how you implemented file one server to new server. – Jinesh Mar 16 at 8:45
  • As of now, I just followed the things in the mentioned URL. Can you please point me out how to send the file to another server that would be very helpful for me? – Siva Mar 16 at 9:01
  • have you add this code $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/cron.log'); $logger = new \Zend\Log\Logger(); $logger->addWriter($writer); $logger->info(METHOD); – Jinesh Mar 16 at 9:01
  • if yes then check cron.log files in var folder. – Jinesh Mar 16 at 9:02
  • I have added that code and in the log file, I can see that the cron job was ran successfully. However, the file is not received in another server. – Siva Mar 16 at 9:04

Your Answer

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

Browse other questions tagged or ask your own question.