开发者

Running a constantly updated script

I have a PHP script that I keep updated and need to run on s开发者_StackOverflow社区everal servers to gather data based on config files like php ini, phpinfo, and other config files. I need to make sure that what's run is always the latest version of the script but this creates an annoying maintenance problem because the script is always being updated.

So I'd like to store the PHP script in another central location and have a generic script that never changes on the server of interest. The generic PHP script sends data to the central script and gets feedback without me having to visit the server to change the code to the new script. How can this be done? Is this an API? and what's the best way to do it? I'm using PHP

If I'm not explaining the problem clearly, please ask me if there's something that's not clear.


You can deploy a php file that will check with the central server if there is a new version of the script, if so download, run it and keep that version along with a version tag.

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

With this approach you can also get some extra benefits, like the ability to setup custom process depending on the machine running the process or get reports sent back to the central server, etc.


Sounds like you need a configuration management tool such as Puppet or cfengine.


You can mount an NFS share for that. Or if you want higher performance iSCSI over GigE will fit the bill. But realistically rsync will probably do you well.


scheduledtask.sh:

svn update DataGatherer.php
php DataGatherer.php
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜