last day (15 days later) » 

12:38
0
Q: Magento 2: Can we run a magento root file from CRON?

BornCoderI want to run a file which i placed in root directory of my magento. How to run that file using CRON ? UPDATE: I have a file name updateData.php in magento root directory. How to run this file from cron? <group id="default"> <job name="daily_csv_file_generate" instance="Namespace\M...

You can explain more details?
I have a file in magento root dir. and i want to run that file from CRON. How ?
You want to read this file or execute any function?
I updated my question. I want to execute function of that file. How to setup in crontab.xml file to run updateData.php file ?
I think you should under pub folder.
12:38
then how to set instance="Namespace\Module\Cron\Test" method="testFile" for pub also ??
Why you need to put this file in root folder or pub?
@BornCoder
Namespace\Module\Cron\Test => you cannot put this file in index or pub.
i set cron and i put code in controller and rest API is not returning any repsonse
but when same crotroller i am calling from browser , its working fine
You can show me your Cron code lines?
for example code of your Cron.
'<?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="daily_csv_file_generate" instance="Salusfoods\Customattribute\Cron\Csv" method="dailyCsvFile">
<schedule>* * * * *</schedule>
</job>
</group>
</config>'
this is my crontab.xml code
and i created a file in customModule/Cron/Csv.php
i am able to call function from cron
The code line of Salusfoods\Customattribute\Cron\Csv?
12:47
ok
I am calling dailyCsvFile function from cron
it is not generating token
I think tomorrow I will check this for you! I left my company and am going to take a path and have dinner.
This is urgent or not?
little bit urgent
Go for dinner bro. I will try to do it from home. :)
 
1 hour later…
14:17
I did this using object and model but i want to do it using REST API.

  last day (15 days later) »