当前位置:网站首页>Xshell batch send command to multiple sessions
Xshell batch send command to multiple sessions
2022-07-26 08:34:00 【ZenPower】
- Applicable scenario
Recently, there is a need to restart services in batches every week , Because there are more than a dozen server nodes involved , And we should distinguish between the primary node and the child node , You have to submit the restart command one by one every time ( To close the service, you need to execute the child nodes first , Then execute the master node ; Start the service and vice versa ), Cumbersome and time-consuming . So I found out XShell Support [ Quick command ] perform [ To the current session ]、[ Current label group ]、[ All conversations ], Solve this problem efficiently .
- Solution
Found during use XShel5 and XShell6 There are slight differences in the version , We use XShell6 For example , The difference will be explained at the bottom :
1、 First , Need to open XShell Of [ Quick command bar ]: see — Quick command — Quick command bar

2、 stay [ Quick command bar ] Add a quick command button : Click on the bottom left corner — Quick command bar menu — Add a button , Or directly above [ Quick command bar ] Double click above

3、 Edit quick command button : Fill in [ label ] And [ String ], The type of operation is [ Send string ], there [ label ] Command description ,[ String ] It's an order to execute , End of input [ String ] after , In order to click the button later, you can directly send commands and execute , Need to return ( Enter and execute directly )

4、 After adding the quick command button , We copied several sessions for testing : stay [ Quick command ] Button — Right click — perform — All conversations , You will find that all windows have executed this command ; Or perform - Current label group , Will execute the command to the current label group

5、 Here's the picture , The current tag group session has executed this command

6、 Corresponding to the session that needs to execute the command separately , You can drag the session tab to the bottom left , Break away from the current tag group , This can distinguish between session execution commands

7、 After leaving the current tag group , You can send commands separately without affecting each other
- XShell6 and XShell5 The difference between ,XShell5 edition , Need to open “ writing ”—“ Write column ”

Specifically “ Quick command bar ” Button , Need to send to current tag group or current session , Need to be in “ writing ” Column to select

边栏推荐
猜你喜欢

BGP routing principle

2022-7-5 personal qualifying 2 competition experience

A little awesome, 130000 a month+

Basic configuration of BGP

Mysql/mariadb (Galera multi master mode) cluster construction

Super nice navigation page (static page)

Bee guitar score high octave and low octave

Kotlin variables and constants

Mycat2 deploy master-slave MariaDB

Nodejs2day (modularization of nodejs, NPM download package, module loading mechanism)
随机推荐
23.10 Admin features
QT note 1
B title: razlika priority queue approach
Leetcode and query question summary
Fluent uses protobuf
关于期刊论文所涉及的一些概念汇编+期刊查询方法
[GUI] GUI programming; AWT package (interface properties, layout management, event monitoring)
If Yi Lijing spits about programmers
2022-7-9 personal qualifying 6 competition experience
Spark scheduling analysis
23.8 using the applicationrunner or commandlinerunner to implement applicationrunner and commandlinerunner
Data validation typeerror: qiao Validate is not a function
Flutter WebView jitter
2022-7-4 personal qualifying 1 competition experience
Daily Note (11) -- word formula input arbitrary matrix
2022/7/18 exam summary
Mycat2 deploy master-slave MariaDB
Flex three column layout
memorandum...
第三天作业