How to implement automatic installation script for mydumper
This article mainly introduces mydumper how to achieve automated installation script, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
#! / usr/bin/expect-f
Set hname [lindex $argv 0]
Set timeout 1
Spawn ssh-p 22000 lilongqian@$hname
Expect {
"yes/no" {send "yes\ r"}
"password" {send "test\ r";}
}
Expect "$"
Send "sudo yum install-y pcre* glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel\ r"
Send "mkdir-p / home/myhomedir/soft/tools\ r"
Send "exit\ r"
Interact eof
Spawn scp-P22000 / home/myhomedir/upload/mydumper/mydumper-0.9.1.tar.gz lilongqian@$hname:/home/myhomedir/soft/tools
Expect {
"yes/no" {send "yes\ r"}
"password" {send "ok\ r";}
}
Interact eof
Spawn ssh-p 22000 lilongqian@$hname
Expect {
"yes/no" {send "yes\ r"}
"password" {send "ok\ r";}
}
Expect "$"
Send "tar-zxvf / home/myhomedir/tools/mydumper-0.9.1.tar.gz-C/home/myhomedir/tools\ r"
Send "cd / home/myhomedir/tools/mydumper-0.9.1\ r"
Send "cmake.\ r"
Send "make\ r"
Send "sudo make install\ r"
Send "exit\ r"
Interact eof
Thank you for reading this article carefully. I hope the article "how to automate the installation script of mydumper" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!