replace osutil path
This commit is contained in:
parent
39a59a0ec8
commit
553e030ccd
@ -24,4 +24,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 oss://${ossPath}/ -f
|
||||||
|
@ -28,7 +28,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
|
cp -f ${workPath}/${identify}.log oss://${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 +0,0 @@
|
|||||||
chmod +x *.sh
|
|
@ -51,7 +51,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
|
cp -f sqlOut.log oss://${ossPath}/${dbHost}/sqlOut.log
|
||||||
}
|
}
|
||||||
function uploadLog()
|
function uploadLog()
|
||||||
{
|
{
|
||||||
@ -60,7 +60,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
|
cp -f ${tempPath}/${identify}.log oss://${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
|
||||||
|
@ -28,7 +28,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
|
cp -f ${workPath}/${identify}.log oss://${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,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cd /tmp/autoDeploy
|
cd /tmp/autoDeploy
|
||||||
./ossutil stat oss://ztupload/html.zip > html_oss.info
|
ossutil stat oss://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,7 +20,7 @@ function compare(){
|
|||||||
if [ ! -f ${projectName}_oss.info ]; then
|
if [ ! -f ${projectName}_oss.info ]; then
|
||||||
touch ${projectName}_oss.info
|
touch ${projectName}_oss.info
|
||||||
fi
|
fi
|
||||||
(~/ossutil stat oss://${ossPath}$fileName | head -n -2) > ${projectName}_upstream_oss.info
|
( stat oss://${ossPath}$fileName | head -n -2) > ${projectName}_upstream_oss.info
|
||||||
upstreamOssInfoMd5=$(md5sum ${projectName}_upstream_oss.info)
|
upstreamOssInfoMd5=$(md5sum ${projectName}_upstream_oss.info)
|
||||||
upstreamOssInfoMd5="${upstreamOssInfoMd5% *}"
|
upstreamOssInfoMd5="${upstreamOssInfoMd5% *}"
|
||||||
locOssInfoMd5=$(md5sum ${projectName}_oss.info)
|
locOssInfoMd5=$(md5sum ${projectName}_oss.info)
|
||||||
@ -41,10 +41,10 @@ function compare(){
|
|||||||
function downloadFromOss(){
|
function downloadFromOss(){
|
||||||
cd $basePath
|
cd $basePath
|
||||||
echo "fileName: " $fileName
|
echo "fileName: " $fileName
|
||||||
~/ossutil cp oss://${ossPath}${fileName} ${fileName}_tmp
|
cp oss://${ossPath}${fileName} ${fileName}_tmp
|
||||||
rm $fileName
|
rm $fileName
|
||||||
mv ${fileName}_tmp $fileName
|
mv ${fileName}_tmp $fileName
|
||||||
(~/ossutil stat oss://${ossPath}$fileName | head -n -2) > ${projectName}_oss.info
|
( stat oss://${ossPath}$fileName | head -n -2) > ${projectName}_oss.info
|
||||||
}
|
}
|
||||||
|
|
||||||
function main(){
|
function main(){
|
||||||
|
@ -6,4 +6,4 @@ ossPath=$1 #末尾别忘了加/
|
|||||||
serviceName=$2
|
serviceName=$2
|
||||||
|
|
||||||
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 > oss://${ossPath}
|
||||||
|
@ -6,7 +6,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 &
|
cp -f $file oss://ztupload/stage/dataCenter/backEnd/$fileName &
|
||||||
echo file: $fileName
|
echo file: $fileName
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user