obs
This commit is contained in:
parent
181aab6a05
commit
34b30baf2f
@ -8,6 +8,8 @@ dbName=$5
|
|||||||
backUpPath=$6
|
backUpPath=$6
|
||||||
ossPath=$7
|
ossPath=$7
|
||||||
|
|
||||||
|
protal=obs
|
||||||
|
|
||||||
PATH=PATH:/usr/bin:/usr/sbin:/usr/local/bin
|
PATH=PATH:/usr/bin:/usr/sbin:/usr/local/bin
|
||||||
|
|
||||||
cd $backUpPath
|
cd $backUpPath
|
||||||
@ -24,4 +26,4 @@ mv ${dbName}.sql sql
|
|||||||
tar -czvf ${dbName}.sql.tar.gz sql
|
tar -czvf ${dbName}.sql.tar.gz sql
|
||||||
|
|
||||||
echo "ossPath: "${ossPath}
|
echo "ossPath: "${ossPath}
|
||||||
ossutil cp ${dbName}.sql.tar.gz oss://${ossPath}/ -f
|
ossutil cp ${dbName}.sql.tar.gz ${protol}://${ossPath}/ -f
|
||||||
|
@ -11,6 +11,7 @@ workPath=$4
|
|||||||
ossLogPath=$5
|
ossLogPath=$5
|
||||||
preName="${fileName%.*}"
|
preName="${fileName%.*}"
|
||||||
|
|
||||||
|
protal=obs
|
||||||
|
|
||||||
PATH=PATH:/usr/bin:/usr/sbin:/usr/local/bin
|
PATH=PATH:/usr/bin:/usr/sbin:/usr/local/bin
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ function uploadLog()
|
|||||||
echo "current user is ${USER}"
|
echo "current user is ${USER}"
|
||||||
echo "current log is " ${workPath}/${identify}.log
|
echo "current log is " ${workPath}/${identify}.log
|
||||||
journalctl -n $count -xe -${ctype} $identify | grep -wv " at " > ${workPath}/${identify}.log
|
journalctl -n $count -xe -${ctype} $identify | grep -wv " at " > ${workPath}/${identify}.log
|
||||||
ossutil cp -f ${workPath}/${identify}.log oss://${ossLogPath}/logs/${identify}.log
|
ossutil cp -f ${workPath}/${identify}.log ${protol}://${ossLogPath}/logs/${identify}.log
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "ok: log ${identify} uploaded to oss!"
|
echo "ok: log ${identify} uploaded to oss!"
|
||||||
return 0
|
return 0
|
||||||
|
@ -13,6 +13,7 @@ ossPath=$7
|
|||||||
projectName="sql"
|
projectName="sql"
|
||||||
projectPath=${tempPath}/${projectName}
|
projectPath=${tempPath}/${projectName}
|
||||||
|
|
||||||
|
protal=obs
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
cd $tempPath
|
cd $tempPath
|
||||||
@ -51,7 +52,7 @@ function replaceAndExec(){
|
|||||||
rm sqlOut.log
|
rm sqlOut.log
|
||||||
cp $tempPath/$sqlFile .
|
cp $tempPath/$sqlFile .
|
||||||
/usr/bin/mysql -u${dbUser} -p${dbPassword} -P${dbPort} -e "$(cat ${sqlFile})" | tee sqlOut.log
|
/usr/bin/mysql -u${dbUser} -p${dbPassword} -P${dbPort} -e "$(cat ${sqlFile})" | tee sqlOut.log
|
||||||
ossutil cp -f sqlOut.log oss://${ossPath}/${dbHost}/sqlOut.log
|
ossutil cp -f sqlOut.log ${protol}://${ossPath}/${dbHost}/sqlOut.log
|
||||||
}
|
}
|
||||||
function uploadLog()
|
function uploadLog()
|
||||||
{
|
{
|
||||||
@ -60,7 +61,7 @@ function uploadLog()
|
|||||||
count=$3
|
count=$3
|
||||||
echo "current user is ${USER}"
|
echo "current user is ${USER}"
|
||||||
journalctl -n $count -xe -${ctype} $identify > ${tempPath}/${identify}.log
|
journalctl -n $count -xe -${ctype} $identify > ${tempPath}/${identify}.log
|
||||||
ossutil cp -f ${tempPath}/${identify}.log oss://${ossPath}/${dbHost}/${identify}.log
|
ossutil cp -f ${tempPath}/${identify}.log ${protol}://${ossPath}/${dbHost}/${identify}.log
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "ok: log ${identify} uploaded to oss!"
|
echo "ok: log ${identify} uploaded to oss!"
|
||||||
return 0
|
return 0
|
||||||
|
@ -8,6 +8,8 @@ workPath=$3
|
|||||||
ossLogPath=$4
|
ossLogPath=$4
|
||||||
user=$USER
|
user=$USER
|
||||||
|
|
||||||
|
protal=obs
|
||||||
|
|
||||||
if [ -n $5 ]; then
|
if [ -n $5 ]; then
|
||||||
user=$5
|
user=$5
|
||||||
fi
|
fi
|
||||||
@ -28,7 +30,7 @@ function uploadLog()
|
|||||||
count=$3
|
count=$3
|
||||||
echo "current user is ${USER}"
|
echo "current user is ${USER}"
|
||||||
journalctl -n $count -xe -${ctype} $identify > ${workPath}/${identify}.log
|
journalctl -n $count -xe -${ctype} $identify > ${workPath}/${identify}.log
|
||||||
ossutil cp -f ${workPath}/${identify}.log oss://${ossLogPath}/logs/${identify}.log
|
ossutil cp -f ${workPath}/${identify}.log ${protol}://${ossLogPath}/logs/${identify}.log
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "ok: log ${identify} uploaded to oss!"
|
echo "ok: log ${identify} uploaded to oss!"
|
||||||
return 0
|
return 0
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
protal=obs
|
||||||
cd /tmp/autoDeploy
|
cd /tmp/autoDeploy
|
||||||
ossutil stat oss://ztupload/html.zip > html_oss.info
|
ossutil stat ${protol}://ztupload/html.zip > html_oss.info
|
||||||
ossInfo=$(cat html_oss.info)
|
ossInfo=$(cat html_oss.info)
|
||||||
out1=${ossInfo##*Etag}
|
out1=${ossInfo##*Etag}
|
||||||
echo $out1
|
echo $out1
|
||||||
|
@ -20,8 +20,8 @@ function compare(){
|
|||||||
if [ ! -f ${fileName}_oss.info ]; then
|
if [ ! -f ${fileName}_oss.info ]; then
|
||||||
touch ${fileName}_oss.info
|
touch ${fileName}_oss.info
|
||||||
fi
|
fi
|
||||||
echo upstream ossPath: oss://${ossPath}$fileName
|
echo upstream ossPath: ${protol}://${ossPath}$fileName
|
||||||
( ossutil stat oss://${ossPath}$fileName | head -n -2) > ${fileName}_upstream_oss.info
|
( ossutil stat ${protol}://${ossPath}$fileName | head -n -2) > ${fileName}_upstream_oss.info
|
||||||
upstreamOssInfoMd5=$(md5sum ${fileName}_upstream_oss.info)
|
upstreamOssInfoMd5=$(md5sum ${fileName}_upstream_oss.info)
|
||||||
upstreamOssInfoMd5="${upstreamOssInfoMd5% *}"
|
upstreamOssInfoMd5="${upstreamOssInfoMd5% *}"
|
||||||
locOssInfoMd5=$(md5sum ${fileName}_oss.info)
|
locOssInfoMd5=$(md5sum ${fileName}_oss.info)
|
||||||
@ -42,10 +42,10 @@ function compare(){
|
|||||||
function downloadFromOss(){
|
function downloadFromOss(){
|
||||||
cd $basePath
|
cd $basePath
|
||||||
echo "fileName: " $fileName
|
echo "fileName: " $fileName
|
||||||
ossutil cp -f oss://${ossPath}${fileName} ${fileName}_tmp
|
ossutil cp -f ${protol}://${ossPath}${fileName} ${fileName}_tmp
|
||||||
rm $fileName
|
rm $fileName
|
||||||
mv ${fileName}_tmp $fileName
|
mv ${fileName}_tmp $fileName
|
||||||
( ossutil stat oss://${ossPath}$fileName | head -n -2) > ${fileName}_oss.info
|
( ossutil stat ${protol}://${ossPath}$fileName | head -n -2) > ${fileName}_oss.info
|
||||||
}
|
}
|
||||||
|
|
||||||
function main(){
|
function main(){
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# ./ossUpgrade.sh "stage/ztsjxxxt/frontEnd/" ztsjxxxt
|
# ./ossUpgrade.sh "stage/ztsjxxxt/frontEnd/" ztsjxxxt
|
||||||
ossPath=$1 #末尾别忘了加/
|
ossPath=$1 #末尾别忘了加/
|
||||||
serviceName=$2
|
serviceName=$2
|
||||||
|
protal=obs
|
||||||
|
|
||||||
sudo journalctl -n 2000 -xeu $serviceName > ${serviceName}.log
|
sudo journalctl -n 2000 -xeu $serviceName > ${serviceName}.log
|
||||||
ossutil cp ${serviceName}.log > oss://${ossPath}
|
ossutil cp ${serviceName}.log > ${protol}://${ossPath}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
dataCenterPath=~/data_center
|
dataCenterPath=~/data_center
|
||||||
|
protal=obs
|
||||||
function fetch()
|
function fetch()
|
||||||
{
|
{
|
||||||
for file in ${dataCenterPath}/jars/*.jar
|
for file in ${dataCenterPath}/jars/*.jar
|
||||||
@ -6,7 +7,7 @@ function fetch()
|
|||||||
if [ -f "$file" ]
|
if [ -f "$file" ]
|
||||||
then
|
then
|
||||||
fileName=${file##*/}
|
fileName=${file##*/}
|
||||||
ossutil cp -f $file oss://ztupload/stage/dataCenter/backEnd/$fileName &
|
ossutil cp -f $file ${protol}://ztupload/stage/dataCenter/backEnd/$fileName &
|
||||||
echo file: $fileName
|
echo file: $fileName
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user