I have a php web app and have written a class that effectively invokes an API which requests data from our 3rd party membership system database. The API returns the data and saves the XML into a file (as it's a very large data set). This xml file is then parsed and I upload some of that data into my web application's database.
It takes approximately 4 hours for the API to return all of the data. Currently I invoke this process by clicking a button on my web page. However, I want to automate the process and schedule it to run every so often but have no idea where to begin or what to even Google. The web app runs on a Windows server which is running xammp. Any help is much appreciated.
I have managed to create a .bat file to execute my php script but I now get several errors in the CMD windows stating that it failed to open any of the files that I include in my script file:
My script file is:
<?php
include '../config.php';
include (ROOT.'/includes/my_session.php');
include (ROOT.'/model/dao.php');
include (ROOT.'/model/miller_api.php');
include (ROOT.'/model/branch_db.php');
$a = new miller_api;
$k = $a->apiRequest('key');
$a->apiRequest('branch', $k);
And here is a screen shot of the errors I am getting: CMD errors
It is quite simple. Create a run.bat file with the following command
C:\xampp\php\php.exe C:\xampp\htdocs\SCRIPTFOLDER\SCRIPT.php
And schedule the run.bat file using windows Task Scheduler
https://www.techsupportalert.com/content/how-schedule-programs-run-automatically-windows-7.htm