Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to implement automatic installation script for mydumper

Shulou Source: shulou.com Published: 2022-06-01 03:00:18 09月22日 Update

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!

Tags: Articles scripts automation value interests at the same time more friends knowledge editing industry information information channels channels references learning help support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info OPPO Reno vpn Apple Shulou Technology