Running a constantly updated script

I have a PHP script that I constantly update and needs to run on several servers to collect data based on configuration files such as php ini, phpinfo and other configuration files. I need to make sure that the launch is always the latest version of the script, but this causes an annoying maintenance problem as the script is always updated.

Therefore, I would like to save the PHP script in another central location and have a common script that never changes on the server of interest. A common PHP script sends data to a central script and receives feedback without me to visit the server to change the code to a new script. How can this be done? Is this an API? and what is the best way to do this? I am using php

If I do not explain the problem clearly, ask me if there is something incomprehensible.

+3
source share
4 answers

You can deploy the php file, which will be checked on the central server, if there is a new version of the script, if so boot, run it and save this version along with the version tag.

Next time check the new version, if the version is the same, just run the local script. Otherwise, repeat the first step.

With this approach, you can also get additional benefits, such as the ability to customize the user process depending on the machine on which this process is running, or sending reports to a central server, etc.

+3
source

, , Puppet cfengine.

+2

You can set the NFS share. Or, if you need better performance, iSCSI through GigE will fit the bill. But realistic rsync will probably do you well.

+2
source

scheduledtask.sh:

svn update DataGatherer.php
php DataGatherer.php
+2
source

Source: https://habr.com/ru/post/1766900/


All Articles