dbUpGrade update
This commit is contained in:
parent
c6e87a35c8
commit
82c526da30
@ -13,6 +13,9 @@ ossPath=$7
|
||||
projectName="sql"
|
||||
projectPath=${tempPath}/${projectName}
|
||||
|
||||
filename_no_extension="${sqlfile%.sql}"
|
||||
dbName="${filename_no_extension:0:3}"
|
||||
|
||||
protal=oss
|
||||
|
||||
function init(){
|
||||
@ -51,6 +54,12 @@ function replaceAndExec(){
|
||||
rm $sqlFile
|
||||
rm sqlOut.log
|
||||
cp $tempPath/$sqlFile .
|
||||
# 获取当前日期并格式化为YYYY-MM-DD的形式
|
||||
current_date=$(date +'%Y-%m-%d')
|
||||
# 获取当前时间并格式化为HH:MM:SS的形式
|
||||
current_time=$(date +'%H:%M:%S')
|
||||
fileName="abc_${current_date}-${current_time}.sql"
|
||||
/usr/bin/mysqldump -u${dbUser} -p${dbPassword} -P${dbPort} $dbname > $fileName
|
||||
/usr/bin/mysql -u${dbUser} -p${dbPassword} -P${dbPort} -e "$(cat ${sqlFile})" | tee sqlOut.log
|
||||
ossutil cp -f sqlOut.log ${protol}://${ossPath}/${dbHost}/sqlOut.log
|
||||
}
|
||||
|
35
replacessh.sh
Normal file
35
replacessh.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
yum install -y openssl-devel zlib-devel
|
||||
wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz
|
||||
tar -xzvf openssl-1.1.1l.tar.gz
|
||||
cd openssl-1.1.1l
|
||||
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib
|
||||
make
|
||||
make install
|
||||
cp -f /root/openssl-1.1.1l/libssl.so.1.1 /usr/lib64/ || true
|
||||
cp -f /root/openssl-1.1.1l/libcrypto.so.1.1 /usr/lib64/ || true
|
||||
|
||||
export PATH=/usr/local/openssl/bin:$PATH
|
||||
|
||||
ldconfig
|
||||
openssl version
|
||||
mv /usr/bin/openssl /usr/bin/openssl_old
|
||||
mv -f /usr/local/openssl/bin/openssl /usr/bin/openssl
|
||||
|
||||
cd ~
|
||||
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.7p1.tar.gz
|
||||
tar -zxvf openssh-9.7p1.tar.gz
|
||||
cd openssh-9.7p1/
|
||||
./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/openssl --without-openssl-header-check
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
cp -r /etc/ssh /etc/ssh_backup
|
||||
systemctl stop sshd
|
||||
sleep 2
|
||||
cp -f /usr/local/openssh/sbin/sshd /usr/sbin/sshd
|
||||
cp -f /usr/local/openssh/bin/ssh /usr/bin/ssh
|
||||
sleep 2
|
||||
systemctl start sshd
|
32
replacessh2.sh
Normal file
32
replacessh2.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
tar -xzvf openssl-1.1.1l.tar.gz
|
||||
cd openssl-1.1.1l
|
||||
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib
|
||||
make
|
||||
make install
|
||||
cp -f /root/openssl-1.1.1l/libssl.so.1.1 /usr/lib64/ || true
|
||||
cp -f /root/openssl-1.1.1l/libcrypto.so.1.1 /usr/lib64/ || true
|
||||
|
||||
export PATH=/usr/local/openssl/bin:$PATH
|
||||
|
||||
ldconfig
|
||||
openssl version
|
||||
mv /usr/bin/openssl /usr/bin/openssl_old
|
||||
mv -f /usr/local/openssl/bin/openssl /usr/bin/openssl
|
||||
|
||||
cd ~
|
||||
tar -zxvf openssh-9.7p1.tar.gz
|
||||
cd openssh-9.7p1/
|
||||
./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/openssl --without-openssl-header-check
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
cp -r /etc/ssh /etc/ssh_backup
|
||||
systemctl stop sshd
|
||||
sleep 2
|
||||
\cp -f /usr/local/openssh/sbin/sshd /usr/sbin/sshd
|
||||
\cp -f /usr/local/openssh/bin/ssh /usr/bin/ssh
|
||||
sleep 2
|
||||
systemctl start sshd
|
Loading…
x
Reference in New Issue
Block a user