K
K
Konstantin Klubkov2019-08-04 17:37:50
PHP
Konstantin Klubkov, 2019-08-04 17:37:50

How to automatically run 100+ php files on a server on a schedule?

I generate tables on the site using the Google Sheets API. It turned out 100+ tables. Each table is 1 php file which creates 1 json file when the script is run. I need that when updating tables in Google Docs, they are updated on the site. Can you please tell me the best way to organize this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Neverov, 2019-08-04
@klubkov94

Well, as far as I know, tables don't have Webhooks. So you have a couple of ways:
1) Create a PHP script that will make requests for another 100 scripts by iterating over the directory with these scripts.
2) Do the same with Node.js. The asynchronous language, it seems to me, is better suited for such a task as triggering long scripts. + will be able to restart the script if one of them breaks. Although this can be done in PHP
3) Just add all 100 scripts to CRON manually. Or through support if you don't have a VPS.

V
Vladislav, 2017-12-07
@ghostiam

After all, the error says that the server does not return the Access-Control-Allow-Origin header or it has the wrong domain, so the ajax request cannot be executed, write the header and everything will work.

R
Roman Frank, 2017-12-07
@Akellacom

https://habrahabr.ru/post/114432/
https://habrahabr.ru/post/120336/grishaev.me/cors
_

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question