This is a creation in Article, where the information may have evolved or changed.
Bulk concurrent execution tool PDO, mainly to solve the large-scale execution of the lock, more secure and convenient operation tools.
itself is a solution to some of the company's internal problems, and there are a lot of specific use of the environment, now pumped out of the parts that can be used.
- Tool Name: PDO (parallel do something) https://github.com/ohlinux/pdo
Installation
Depend on
- A central control machine and a managed machine are required to establish a cryptographic key relationship.
- Need to have a go language environment to compile and install. The bin file is not available here.
- The environment you are testing has, CentOS MacOS.
Compile
Obtain dependent third-party libraries first:
go get github.com/cihub/seeloggo get github.com/robfig/config
Install the GO environment.
go build pdo.go
Configuration file directory, default in ~/.pdo. If not specified here.
PDO structure
PDO processing Object Source
There are three ways to get the list of machines and the corresponding paths. (This particular type of database was removed)
- -f file, the list file for host, can be a column, or two columns have related directory dependencies. There are examples later.
- -a app name;-p product name;-A supports multiple apps with app1,app2 comma Delimited. (This is the source of the database, because it is a specific environment, so no longer)
- Standard input Cat 1.host | Pdo
- -R when used, the list of failures can be generated automatically. See the example "Retry function" in detail
PDO list filtering
If the list name is such a structure, xxx.yyy then filter is yyy, if there is no need for this, can be ignored.
- -I yf01,dbl01,cq02 filter the name of the physical room, separated by multiple commas.
- -I jx/tc filter logic room, CONFIGURED in-C configure file
In the configuration file:
[IDC] JX:yf01,cq01,dbl01,ai01 TC:cq02,tc,m1,db01
Log records
The main record of the log users, the use of the command, to ensure that the multi-person operation can be viewed.
Log profile View Github.com/cihub/seelog
Master configuration file Format View Github.com/robfig/config
PDO function
There will be hosts and commands and a single-unit execution confirmation.
- -R number, concurrency, default = 1
- -c Configure, config file, default = ~/.pdo/pdo.conf
- -o dir, output directory, default is empty, will be printed on the screen, if added will only print to the file.
- The-cmd command, the command abbreviation, is in the configuration file.
- -T time-out ends with a timeout of 5min by default.
- -Y do not enter confirmation.
- -c copy file/dir, copy file/or directory, requires the existence of an unwarranted directory.
- -e script executes scripts.
- -T performs a time interval of 0, which is better than the sleep effect in the command.
- -R Retry, after a failed retry function, records the last failed list and the list that was not executed by CTRL + C.
- -temp template name, in the configuration.
- -B build-in can embed scripts when using template templates.
- -V View version
- -show View how the display "Row" row is displayed .
- The match string can be-match when the row is displayed. Highlight red display.
- -rule in the in-line display mode, you can use rule in conf to define the action of different match strings. (Temporarily none)
PDO does not complete the function
- De-weight with multiple instances, product line restart concurrency optimization.
- Web page presentation functionality.
Precautions
- Operation commands, enclosed in quotation marks, must be kept at the end of the command.
Examples of use of PDO
Configuration file
[PDO] logconf:/home/work/.pdo/log.xml [IDC] JX:yf01,cq01,dbl01,ai01,jx,cp01 TC:cq02,tc,m1,db01,st01 [TEMPLATE] container : /home/work/.pdo/template/container.sh startbykill : /home/work/.pdo/template/startbykill.sh [CMD] restart: bash bin/xxxControl.sh N%%N%%N%%restart findLog: find xxx00* -name "debug" -type d findCount: ls log | wc -l
Host list file
The first column must be Host,hostname or IP, and the second column is the path to the command's work.
cat godir/1.listyf-xxx-app01.yf01 /home/work/xxx001yf-xxx-app02.yf01 /home/work/xxx004yf-xxx-app03.yf01 /home/work/xxx002
Using the Piping method
cat 1.list | pdo -r 2 "pwd">>>> Welcome ajian...yf-xxx-pre01.vm -/home/work/xxx001 yf-xxx-app01.yf01 -/home/work/xxx001yf-xxx-app02.yf01 -/home/work/xxx001 yf-xxx-app03.yf01 -/home/work/xxx001yf-xxx-app04.yf01 -/home/work/xxx001 1-xxx-app17.m1 -/home/work/xxx001m1-xxx-app25.m1 -/home/work/xxx001 m1-xxx-app0220.m1 -/home/work/xxx001m1-xxx-app0154.m1 -/home/work/xxx004 cq01-xxx-app0242.cq01 -/home/work/xxx003ai-xxx-app01.ai01 -/home/work/xxx004 db-xxx-app17.db01 -/home/work/xxx003db-xxx-app63.db01 -/home/work/xxx001#--Total--# 13#---CMD---# pwd//每一次确认Continue (y/n):ygo on ...[1/13] yf-xxx-app01.yf01 [SUCCESS]./home/work/xxx001Continue (y/n):[1/13] yf-xxx-pre01.vm [SUCCESS]./home/work/xxx001//单台执行完 第二次确认Continue (y/n)://后面就是按2并发执行.
Using the Shorthand command
This is primarily a one-line command to resolve some repetitive and complex locks. The following restart command is cumbersome, but it is convenient to enter it after the conversion.
-cmd is abbreviated command = Bash bin/xxxcontrol.sh n%%n%%n%%restart
$ pdo-f 1.list-cmd restart>>>> Welcome ajian...yf-xxx-app01.yf01-/home/work/xxx001 yf-xxx-app02. Yf01-/home/work/xxx001yf-xxx-app03.yf01-/home/work/xxx001 yf-xxx-app04.yf01-/HOME/WORK/XXX001YF -xxx-app00.yf01-/home/work/xxx001 yf-xxx-app0148.yf01-/home/work/xxx004dbl-xxx-app0109.dbl01-/home/wo rk/xxx003 m1-xxx-app17.m1-/home/work/xxx001m1-xxx-app25.m1-/home/work/xxx001 m1-xxx-app0220.m1 -/HOME/WORK/XXX001M1-XXX-APP0154.M1-/home/work/xxx004 cq01-xxx-app0242.cq01-/home/work/xxx003cq01-xxx -app0179.cq01-/home/work/xxx001 cq01-xxx-app0131.cq01-/home/work/xxx005st01-xxx-app03.st01-/home/work/xxx 001 st01-xxx-app04.st01-/home/work/xxx001st01-xxx-app02.st01-/home/work/xxx001 st01-xxx-app00.st01 -/home/work/xxx001st01-xxx-app05.st01-/home/work/xxx001 cq02-xxx-app0258.cq02-/HOME/WORK/XXX001CQ02-XXX-APP02 87.cq02-/home/work/xxx001 JX-XXX-APP17.JX-/home/work/xxx001ai-xxx-app10.ai01-/home/work/xxx001 db-xxx-app17.db01 -/home/work/xxx003#--total--# 24#---CMD---# bash bin/xxxcontrol.sh n%%n%%n%%restartcontinue (y/n):
-o input and screen output
Using a specified output directory with-O will no longer be printed on the screen, primarily for the grep logs. The speed is much faster than the screen printing and is written in real time.
$ Cat 1.list | Pdo-o xxxout "pwd" >>>> Welcome ajian...yf-xxx-app01.yf01-/home/work/xxx001 yf-xxx-app02.yf01 -/home/work/xxx001yf-xxx-app03.yf01-/home/work/xxx001 yf-xxx-app04.yf01-/home/work/xxx001yf-xxx-app00 . yf01-/home/work/xxx001 yf-xxx-app0148.yf01-/home/work/xxx004dbl-xxx-app0109.dbl01-/home/work/xxx003 M1-XXX-APP17.M1-/home/work/xxx001m1-xxx-app25.m1-/home/work/xxx001 m1-xxx-app0220.m1-/ho ME/WORK/XXX001M1-XXX-APP0154.M1-/home/work/xxx004 cq01-xxx-app0242.cq01-/home/work/xxx003cq01-xxx-app0179.c q01-/home/work/xxx001 cq01-xxx-app0131.cq01-/home/work/xxx005st01-xxx-app03.st01-/home/work/xxx001 st0 1-xxx-app04.st01-/home/work/xxx001st01-xxx-app02.st01-/home/work/xxx001 st01-xxx-app00.st01-/home/wor k/xxx001st01-xxx-app05.st01-/home/work/xxx001 cq02-xxx-app0258.cq02-/home/work/xxx001cq02-xxx-app0287.cq02 -/home/work/xxx001 cq02-xxx-app0212.cq02-/HOME/WORK/XXX001JX-XXX-APP17.JX-/home/work/xxx001 ai-xxx-app10.ai01 -/HOME/WORK/XXX001DB-XXX-APP17.DB01-/home/work/xxx003#--total--# 25#---CMD---# pwdcontinue (y/n): Ygo on. .. [1/25] yf-xxx-app01.yf01 [SUCCESS]. Continue (y/n): Ygo on ... [2/25] yf-xxx-app02.yf01 [SUCCESS]. [3/25] yf-xxx-app03.yf01 [SUCCESS]. [4/25] yf-xxx-app04.yf01 [SUCCESS]. [5/25] yf-xxx-app00.yf01 [SUCCESS]. [6/25] yf-xxx-app0148.yf01 [SUCCESS]. [7/25] dbl-xxx-app0109.dbl01 [SUCCESS]. [8/25] m1-xxx-app17.m1 [SUCCESS]. [9/25] m1-xxx-app25.m1 [SUCCESS]. [10/25] m1-xxx-app0220.m1 [SUCCESS]. [11/25] m1-xxx-app0154.m1 [SUCCESS]. [12/25] cq01-xxx-app0242.cq01 [SUCCESS]. [13/25] cq01-xxx-app0179.cq01 [SUCCESS]. [14/25] cq01-xxx-app0131.cq01 [SUCCESS]. [15/25] st01-xxx-app03.st01 [SUCCESS]. [16/25] st01-xxx-app04.st01 [SUCCESS]. [17/25] st01-xxx-app02.st01 [SUCCESS]. [18/25] st01-xxx-app00.st01 [SUCCESS]. [19/25] st01-xxx-app05.st01 [SUCCESS]. [20/25] Cq02-xxx-app0258.cq02 [SUCCESS]. [21/25] cq02-xxx-app0287.cq02 [SUCCESS]. [22/25] cq02-xxx-app0212.cq02 [SUCCESS]. [23/25] JX-XXX-APP17.JX [SUCCESS]. [24/25] ai-xxx-app10.ai01 [SUCCESS]. [25/25] db-xxx-app17.db01 [SUCCESS].
Timeout killed process
Time with units, such as 1 seconds 1s, 1 minutes 1m, 1 hours 1h.
The 1.log here is a large file.
$ pdo-f 1.list-t 1s-o out/-R 3 "Cat 1.log" >>>> Welcome ajian...yf-xxx-app01.yf01-/home/work/xxx001 Yf-xxx-app02.yf01-/home/work/xxx001yf-xxx-app03.yf01-/home/work/xxx001 yf-xxx-app04.yf01-/h Ome/work/xxx001yf-xxx-app00.yf01-/home/work/xxx001 yf-xxx-app0148.yf01-/HOME/WORK/XXX004DBL-XXX-APP0109.D Bl01-/home/work/xxx003 m1-xxx-app17.m1-/HOME/WORK/XXX001M1-XXX-APP25.M1-/home/work/xxx001 M1 -XXX-APP0220.M1-/home/work/xxx001m1-xxx-app0154.m1-/home/work/xxx004 cq01-xxx-app0242.cq01-/home/wo rk/xxx003cq01-xxx-app0179.cq01-/home/work/xxx001 cq01-xxx-app0131.cq01-/home/work/xxx005st01-xxx-app03.st01 -/home/work/xxx001 st01-xxx-app04.st01-/home/work/xxx001st01-xxx-app02.st01-/home/work/xxx001 st01-xxx -app00.st01-/home/work/xxx001st01-xxx-app05.st01-/home/work/xxx001 cq02-xxx-app0258.cq02-/home/work/xxx 001cq02-xxx-app0287.cq02 -/home/work/xxx001 cq02-xxx-app0211.cq02-/home/work/xxx001cq02-xxx-app0212.cq02-/home/work/xxx001 jx-xxx -APP17.JX-/home/work/xxx001ai-xxx-app10.ai01-/home/work/xxx001 db-xxx-app17.db01-/home/work/x xx003#--total--# 26#---CMD---# cat log/ral-zoo.logcontinue (y/n): Ygo on ... [1/26] yf-xxx-app01.yf01 [time over killed]. Continue (y/n): Ygo on ... [2/26] yf-xxx-app04.yf01 [time over killed]. [3/26] yf-xxx-app03.yf01 [time over killed]. [4/26] yf-xxx-app02.yf01 [time over killed]. [5/26] yf-xxx-app0148.yf01 [SUCCESS]. [6/26] dbl-xxx-app0109.dbl01 [SUCCESS]. [7/26] yf-xxx-app00.yf01 [time over killed]. [8/26] m1-xxx-app0220.m1 [SUCCESS]. [9/26] m1-xxx-app25.m1 [time over killed]. [10/26] m1-xxx-app17.m1 [time over killed]. [11/26] m1-xxx-app0154.m1 [SUCCESS]. [12/26] cq01-xxx-app0242.cq01 [SUCCESS]. [13/26] cq01-xxx-app0179.cq01 [time over killed]. [14/26] cq01-xxx-app0131.cq01 [SUCCESS]. [15/26] st01-xxx-app03.st01 [time over killed]. [16/26] St01-xxx-app04.st01 [Time over killed]. [17/26] st01-xxx-app02.st01 [time over killed]. [18/26] st01-xxx-app00.st01 [time over killed]. [19/26] st01-xxx-app05.st01 [time over killed]. [20/26] cq02-xxx-app0211.cq02 [SUCCESS]. [21/26] cq02-xxx-app0258.cq02 [SUCCESS]. [22/26] cq02-xxx-app0287.cq02 [SUCCESS]. [23/26] ai-xxx-app10.ai01 [SUCCESS]. [24/26] cq02-xxx-app0212.cq02 [SUCCESS]. [25/26] JX-XXX-APP17.JX [time over killed]. [26/26] db-xxx-app17.db01 [SUCCESS].
-C Copy File
Copy file is actually can copy directory, as long as the remote directory is present, there will be no error.
$ cat 1.host | pdo -c get.sh /tmp/>>>> Welcome ajian...yf-xxx-upload05.yf01 -/home/work yf-xxx-upload01.yf01 -/home/workyf-xxx-upload02.yf01 -/home/work#--Total--# 3#---CMD---# get.sh --> /tmp/Continue (y/n):ygo on ...[1/3] yf-xxx-upload05.yf01 [SUCCESS].Continue (y/n):ygo on ...[2/3] yf-xxx-upload01.yf01 [SUCCESS].[3/3] yf-xxx-upload02.yf01 [SUCCESS].//检查下文件$ cat 1.host | pdo "ls /tmp/get.sh">>>> Welcome ajian...yf-xxx-upload05.yf01 -/home/work yf-xxx-upload01.yf01 -/home/workyf-xxx-upload02.yf01 -/home/work#--Total--# 3#---CMD---# ls /tmp/get.shContinue (y/n):ygo on ...[1/3] yf-xxx-upload05.yf01 [SUCCESS]./tmp/get.shContinue (y/n):ygo on ...[2/3] yf-xxx-upload01.yf01 [SUCCESS]./tmp/get.sh[3/3] yf-xxx-upload02.yf01 [SUCCESS]./tmp/get.sh
Retry function
-R is the equivalent of the fourth list source, which can be used when executing an error, or CTRL + C, to prevent the list from repeatedly executing certain commands.
This time more than two servers, two units are not the above script file. So the new server will be error-free.
$ Cat 2.list | PDO "ls/tmp/get.sh" >>>> Welcome ajian...yf-xxx-upload05.yf01-/home/work yf-xxx-upload01.yf01 -/home/workyf-xxx-upload02.yf01-/home/work yf-xxx-upload03.yf01-/home/workyf-xxx-upload04.yf01 -/home/work#--total--# AA---CMD---# ls/tmp/get.shcontinue (y/n): Ygo on ... [1/5] yf-xxx-upload05.yf01 [Success]./tmp/get.shcontinue (y/n): Ygo on ... [2/5] yf-xxx-upload01.yf01 [SUCCESS]./TMP/GET.SH[3/5] yf-xxx-upload02.yf01 [SUCCESS]./TMP/GET.SH[4/5] yf-xxx-upload03.yf01 [failed].ls:/tmp/get.sh:no such file or DIRECTORY[5/5] yf-xxx-upload04.yf01 [FAILED].ls:/tmp/get . sh:no such file or directory//use-R to get a list of the last failed execution. $pdo-R "ls/tmp/get.sh" >>>> Welcome ajian...yf-xxx-up load03.yf01-/home/work yf-xxx-upload04.yf01-/home/work#--total--#---CMD---# ls/tmp/get.shcontinu E (y/n): Ygo on ... [YF-XXX-UPLOAD03.YF01] [failed].ls:/tmp/get.sh:no such file or directory//if the use of CTRL + C interrupts the list,-R will rememberThe record is not finished (including a list that has been executed but failed) $ cat 1.host | Pdo-t 10s "ls/tmp/get.sh" >>>> Welcome ajian...yf-xxx-upload05.yf01-/home/work yf-xxx-upload0 1.yf01-/home/workyf-xxx-upload02.yf01-/home/work yf-xxx-upload03.yf01-/home/workyf-xxx-upload04.y F01-/home/work#--total--# AA---CMD---# ls/tmp/get.shcontinue (y/n): Ygo on ... [1/5] yf-xxx-upload05.yf01 [Success]./tmp/get.shcontinue (y/n): Ygo on ... [2/5] yf-xxx-upload01.yf01 [success]./tmp/get.sh^c$ pdo-r "ls/tmp/get.sh" >>>> Welcome Ajian ... Yf-xxx-upload02.yf01-/home/work yf-xxx-upload03.yf01-/home/workyf-xxx-upload04.yf01-/home/work#-- total--# 3#---CMD---# ls/tmp/get.shcontinue (y/n): Ygo on ... [1/3] yf-xxx-upload02.yf01 [Success]./tmp/get.shcontinue (y/n):
# #-E script execution function
$ cat t.sh#!/bin/bashcd /tmp/ && pwdecho "test"touch /tmp/t.log$ cat 1.host | pdo -e t.sh>>>> Welcome ajian...yf-xxx-upload05.yf01 -/home/work yf-xxx-upload01.yf01 -/home/workyf-xxx-upload02.yf01 -/home/work#--Total--# 3#---CMD---# Script: t.shContinue (y/n):ygo on ...[1/3] yf-xxx-upload05.yf01 [SUCCESS]./tmptest
Template Features
Template function is mainly to solve the repetitive script modification action, can be cured into some templates, directly used.
You can add a template yourself in the configuration
$ cat ~/.pdo/pdo.conf[TEMPLATE]container : /home/work/.pdo/template/container.sh
Template content, which is mainly in the XXXXXX directory on a single server to operate. {{. CMD} is the location that will be replaced.
$ cat /home/work/.pdo/template/container.sh#!/bin/bashgrep -l "^appName:" /home/work/xxx[0-9][0-9][0-9]/xxx.conf | while read file ; doeval $(awk '{if($1 ~ /xxxPath/){printf "apppath=%s\n",$2};if($1 ~ /appName/){printf "appName=%s",$2}}' $file)echo $appNameif [ -d "$apppath" ];then cd $apppath {{.CMD}}fidone
Using the EMBED command
$ pdo-a xxxtest-temp container "pwd" >>>> Welcome Ajian ... yf-xxx-app02.yf01-/home/work/xx x001 yf-xxx-app03.yf01-/home/work/xxx001 yf-xxx-app00.yf01-/home/work/xxx001 yf-xxx-app0148.yf01 -/home/work/xxx004 dbl-xxx-app0109.dbl01-/home/work/xxx003 m1-xxx-app0220.m1-/home/work/xxx001 m 1-XXX-APP0154.M1-/home/work/xxx004 cq01-xxx-app0242.cq01-/home/work/xxx003 cq01-xxx-app0179.cq01-/ho me/work/xxx001 cq02-xxx-app0258.cq02-/home/work/xxx001 cq02-xxx-app0287.cq02-/home/work/xxx001 cq02-xxx-a pp0211.cq02-/home/work/xxx001 jx-xxx-app17.jx-/home/work/xxx001 db-xxx-app17.db01-/home/work/x xx003 #--total--# #---CMD---# pwd Continue (y/n): Y go on ... [1/14] yf-xxx-app02.yf01 [SUCCESS]. xxxtest/home/work/xxx001 jingyan/home/work/xxx002 pc_anti/home/work/xxx003 bakan/home/work/xxx004 Smallapp/home/work/xxx006 appui/home/work/xxx008 Continue (y/n): N exit ...
can also embed scripts
Script contents $ cat 1.shecho "1.sh" pwd//embedded script using-b$ pdo-a xxxtest-temp container-b 1.sh>>>> Welcome ajian...yf-xxx-ap P02.yf01-/home/work/xxx001 yf-xxx-app03.yf01-/home/work/xxx001yf-xxx-app00.yf01-/home/work/xxx0 YF-XXX-APP0148.YF01-/home/work/xxx004dbl-xxx-app0109.dbl01-/home/work/xxx003 M1-XXX-APP0220.M1- /HOME/WORK/XXX001M1-XXX-APP0154.M1-/home/work/xxx004 cq01-xxx-app0242.cq01-/home/work/xxx003cq01-xxx-app017 9.cq01-/home/work/xxx001 cq02-xxx-app0258.cq02-/home/work/xxx001cq02-xxx-app0287.cq02-/home/work/xxx001 cq02-xxx-app0211.cq02-/HOME/WORK/XXX001JX-XXX-APP17.JX-/home/work/xxx001 db-xxx-app17.db01-/home/ work/xxx003#--total--# 14#---CMD---#Continue (y/n): Ygo on ... [1/14] yf-xxx-app02.yf01 [success].xxxtest1.sh/home/work/xxx001jingyan1.sh/home/work/xxx002pc_anti1.sh/home/work /xxx003bakan1.sh/home/work/xxx004smallapp1.sh/home/work/xxx006appui1.sh/home/work/xxx008
Line display and matching
There are two usage scenarios for this feature:
- A bit like multi tail can be implemented to tail multiple logs simultaneously, displayed in one screen, and can be highlighted for match strings.
- If the output is a single line of output, no status display will display the added beauty and accessibility.
So this kind of display depends on the chronological order of the time, interleaved output.
Take the Redis migration process as an example:
Redis migrated to a rare original primary one from, new and new from. During the migration process, you need to observe the changes of four servers simultaneously. If it is a tail log for four servers per SSH It is cumbersome and error prone.
Now use the PDO command:
List of operating hosts 1.list Tc-yyy-redis40.tc/home/yyy/redis-shard3//old master Cq02-yyy-redis80.cq02/home/yyy/redis-sh Ard3//new master yf-yyy-redis40.yf01/home/yyy/redis-shard3//old slave jx-yyy-redis80.jx/home/yyy/redis-shard3/ /new slave First step: yf-yyy-redis40.yf01 to cq02-yyy-redis80.cq02 #命令 #cat 1.list | Pdo-r 5-y-show Row-match "Success" "Tail-f Log/redis.log" > Yf-yyy-redis40.yf01 >> [11523] Jan 1 3:56:51 * Slave ask for new-synchronization//be asked to sync > cq02-yyy-redis80.cq02 >> [14752] 13:56:58 * ( Non critical): Master does not understand replconf listening-port:reading from master:connection timed out > Yf-yy Y-redis40.yf01 >> [11523] Jan 13:56:58 * Slave ask for synchronization > Yf-yyy-redis40.yf01 > > [11523] Jan 13:56:58 * Starting BGSAVE for SYNC > Yf-yyy-redis40.yf01 >> [11523] Jan 13:56:58 * Background saving started by PID 22855 >Yf-yyy-redis40.yf01 >> [22855] Jan 13:58:31 * DB saved on disk//dump to disk > yf-yyy-redis40.yf01 >> [11523] Jan 13:58:31 * Background saving terminated with success > cq02-yyy-redis80.cq02 >> [14 752] Jan 13:58:31 * Master <-> SLAVE sync:receiving 1868940396 bytes from master//from received to main file > Cq02-yyy-re Dis80.cq02 >> [14752] Jan 13:58:47 * MASTER <-> SLAVE sync:loading DB in memory//load the received file into RAM > Yf-yyy-redis40.yf01 >> [11523] Jan 13:58:47 * Synchronization with slave succeeded//file Sync success > Cq02-yy Y-redis80.cq02 >> [14752] Jan 14:01:21 # Update masterstarttime[1382324097] after loading db > cq02-yyy- Redis80.cq02 >> [14752] Jan 14:01:21 * aa:see masterstarttime:ip[10.36.114.56], port[9973], timestamp[138232 4097] > cq02-yyy-redis80.cq02 >> [14752] Jan 14:01:21 * Write aof_global_offset[92961804447] to new aof_ FILE[46] Success > Cq02-yyy-redis80.cq02 >> [14752] Jan 14:01:21 * Master <-> SLAVE sync:finished with success//slave complete Master From the synchronization, the first step has ended.
Description
- Because Tail-f is not actively quitting the command, you need to use-Y and use-R to increase the concurrency, or it will be a single display, instead of showing the later.
- Match is a matching string that is temporarily not supported, and is highlighted. Red display.
- -show now only supports row, the default is the original way of caching output.
Here is a test script: randomly printing a digital 1.sh
#!/bin/bash for x in `seq 1 10` ; do echo $x sleep $[ ( $RANDOM % 4 ) + 1 ]s done //可以使用如下命令: # cat 1.list | pdo -r 5 -y -show row -match "5" -e 1.sh
There are many more combinations, too.