用于服务器维护脚本的BASH或PHP? [关闭]

Traditionally I've written the majority of my server maintenance scripts in bash like most people, however recently I've found myself move more towards php cli scripts for this due to ease of development and increased functionality.

I'm generally a 'right tools for the job' type person so am comfortable using both in the right context but am thinking of moving everything to PHP for consistency.

Does anyone thing this is a bad idea or have any thoughts as to why maintenance scripting with PHP might be a bad idea?

It's a tradeoff. Using PHP means that, if you ever need to build an additional (or replacement) server, you need to have PHP installed on it before any of your management scripts will work; also, if you have additional people helping you with server management in the future, you need to make sure they know PHP even if they're not otherwise involved with the web part, while they probably already know bash.

On the flip side, there is the consistency argument; you might also find it easier to bring web folks over into system management instead of the other way around, in which case using PHP for system management is an advantage.

(The performance argument doesn't bother me; neither one is made for performance.)

In my opinion, bash will give you a better performance compared to PHP scripts, since PHP are for Web Scripting, and so also does not fit in the "right tool for this job" category.