xcmd

command module
v0.0.0-...-7698fdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

xcmd

并发执行脚本

./bin/xcmd --command="php -f ./phpscripts/echo.php command test --siteID={{.}}" --parameters="1,2,3,4"

demo.gif

xcmd-demo

features

  • 依据模板变量,执行多脚本 --command="executable command --siteID={{.}}" --parameters="1,2,3,4"
  • 可选并发、顺序执行: --concurrent=true/false
  • 超时关闭: --contextDeadline=60 (60s后关闭子进程)
  • 最大并发数: --maxProcess=10 为防止并发进程过多导致内存过高触发OOM,可配置最大并发数
  • 僵尸进程检测: --outputCheckDeadline=30 (30s内无任何输出,包括stdout和stderr,将会被kill掉)
  • 定时向std输出文本,防止主进程被当成无输出脚本关闭: --knockInterval=2
  • 顺序输出所有脚本的标准输出
  • 优雅退出,收到系统退出指令后,终端子进程并输出子进程的std后再退出主进程

TODO

  • 将子进程设置为一个进程组,采用syscall来杀死进程组

Documentation

Overview

Copyright © 2019 clannadxr <clannadxr@hotmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL