File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ CURDIR=$(cd "$(dirname "$0")"; pwd);
1111g_HOST_LIST=$1
1212g_THREAD_NUM=300
1313g_PORT=22
14+ g_LIMIT=0
1415TMPFILE=" pipe.$$ "
1516SSH=" ssh -n -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o ConnectTimeout=5 "
1617SCP=' scp -q -r -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o ConnectTimeout=5 '
@@ -46,6 +47,7 @@ Options:
4647 -c, --concurrent num Thread Nummber for run the command at same time, default: 1.
4748 -s, --ssh Use ssh authorized_keys to login without password query from DB.
4849 -p, --port Use port instead of defult port:22.
50+ -l, --limit Limit num for host to run when limit less then all host num.
4951 -h, --help Print this help infomation.
5052
5153Require:
@@ -81,6 +83,10 @@ _parse_options()
8183 g_PORT=${2}
8284 shift 2
8385 ;;
86+ -l|--limit)
87+ g_LIMIT=${2}
88+ shift 2
89+ ;;
8490 -h|--help)
8591 usage
8692 exit
163169 fi
164170 unset fchar
165171
172+ if [ " x$g_LIMIT " != " x0" ]; then
173+ if [ " $g_LIMIT " -le " $INDEX " ]; then
174+ _trace " Reach limit num of $g_LIMIT "
175+ break
176+ fi
177+ fi
178+
166179 _trace " [$INDEX ] start ${HOST} ......"
167180 read < & 9
168181
You can’t perform that action at this time.
0 commit comments