obs
This commit is contained in:
parent
181aab6a05
commit
34b30baf2f
@ -8,6 +8,8 @@ dbName=$5
|
||||
backUpPath=$6
|
||||
ossPath=$7
|
||||
|
||||
protal=obs
|
||||
|
||||
PATH=PATH:/usr/bin:/usr/sbin:/usr/local/bin
|
||||
|
||||
cd $backUpPath
|
||||
@ -24,4 +26,4 @@ mv ${dbName}.sql sql
|
||||
tar -czvf ${dbName}.sql.tar.gz sql
|
||||
|
||||
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
|
||||
preName="${fileName%.*}"
|
||||
|
||||
protal=obs
|
||||
|
||||
PATH=PATH:/usr/bin:/usr/sbin:/usr/local/bin
|
||||
|
||||
@ -28,7 +29,7 @@ function uploadLog()
|
||||
echo "current user is ${USER}"
|
||||
echo "current log is " ${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
|
||||
echo "ok: log ${identify} uploaded to oss!"
|
||||
return 0
|
||||
|
@ -13,6 +13,7 @@ ossPath=$7
|
||||
projectName="sql"
|
||||
projectPath=${tempPath}/${projectName}
|
||||
|
||||
protal=obs
|
||||
|
||||
function init(){
|
||||
cd $tempPath
|
||||
@ -51,7 +52,7 @@ function replaceAndExec(){
|
||||
rm sqlOut.log
|
||||
cp $tempPath/$sqlFile .
|
||||
/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()
|
||||
{
|
||||
@ -60,7 +61,7 @@ function uploadLog()
|
||||
count=$3
|
||||
echo "current user is ${USER}"
|
||||
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
|
||||
echo "ok: log ${identify} uploaded to oss!"
|
||||
return 0
|
||||
|
@ -8,6 +8,8 @@ workPath=$3
|
||||
ossLogPath=$4
|
||||
user=$USER
|
||||
|
||||
protal=obs
|
||||
|
||||
if [ -n $5 ]; then
|
||||
user=$5
|
||||
fi
|
||||
@ -28,7 +30,7 @@ function uploadLog()
|
||||
count=$3
|
||||
echo "current user is ${USER}"
|
||||
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
|
||||
echo "ok: log ${identify} uploaded to oss!"
|
||||
return 0
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
protal=obs
|
||||
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)
|
||||
out1=${ossInfo##*Etag}
|
||||
echo $out1
|
||||
|
@ -20,8 +20,8 @@ function compare(){
|
||||
if [ ! -f ${fileName}_oss.info ]; then
|
||||
touch ${fileName}_oss.info
|
||||
fi
|
||||
echo upstream ossPath: oss://${ossPath}$fileName
|
||||
( ossutil stat oss://${ossPath}$fileName | head -n -2) > ${fileName}_upstream_oss.info
|
||||
echo upstream ossPath: ${protol}://${ossPath}$fileName
|
||||
( ossutil stat ${protol}://${ossPath}$fileName | head -n -2) > ${fileName}_upstream_oss.info
|
||||
upstreamOssInfoMd5=$(md5sum ${fileName}_upstream_oss.info)
|
||||
upstreamOssInfoMd5="${upstreamOssInfoMd5% *}"
|
||||
locOssInfoMd5=$(md5sum ${fileName}_oss.info)
|
||||
@ -42,10 +42,10 @@ function compare(){
|
||||
function downloadFromOss(){
|
||||
cd $basePath
|
||||
echo "fileName: " $fileName
|
||||
ossutil cp -f oss://${ossPath}${fileName} ${fileName}_tmp
|
||||
ossutil cp -f ${protol}://${ossPath}${fileName} ${fileName}_tmp
|
||||
rm $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(){
|
||||
|
@ -4,6 +4,7 @@
|
||||
# ./ossUpgrade.sh "stage/ztsjxxxt/frontEnd/" ztsjxxxt
|
||||
ossPath=$1 #末尾别忘了加/
|
||||
serviceName=$2
|
||||
protal=obs
|
||||
|
||||
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
|
||||
protal=obs
|
||||
function fetch()
|
||||
{
|
||||
for file in ${dataCenterPath}/jars/*.jar
|
||||
@ -6,7 +7,7 @@ function fetch()
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
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
|
||||
fi
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user