upload_OSS.sh

#!/bin/bash
#########################################
#Usage: upload_OSS.sh
#Author: Danny
#Company: BPO Solutions
#Version: 1.0
#########################################python

UPLOADFILE=$(date +%Y-%m-%d)
TIMEDIR=$(date +%Y%m)
FILENAME=$(date +%Y-%m-%d-%H-%M)mysql

#p3306上傳數據 zhuamob2
python2.7 /usr/bin/osscmd mkdir oss://zhuamobbak/mysqlbak/3306/zhuamob2/${TIMEDIR}
cd /home/danny/mysql_bak/zhuamob2
python2.7 /usr/bin/osscmd put ${UPLOADFILE}* oss://zhuamobbak/mysqlbak/3306/zhuamob2/${TIMEDIR}/${FILENAME}_zhuamob2_mysql.bz2sql

#p3307上傳數據 wifi
python2.7 /usr/bin/osscmd mkdir oss://zhuamobbak/mysqlbak/3307/wifi/${TIMEDIR}
cd /home/danny/mysql_bak/wifi
python2.7 /usr/bin/osscmd put ${UPLOADFILE}* oss://zhuamobbak/mysqlbak/3307/wifi/${TIMEDIR}/${FILENAME}_wifi_mysql.bz2bash

#p3308上傳數據 log_analyse wifiinfo zmbox
python2.7 /usr/bin/osscmd mkdir oss://zhuamobbak/mysqlbak/3308/log_analyse/${TIMEDIR}
cd /home/danny/mysql_bak/log_analyse
python2.7 /usr/bin/osscmd put ${UPLOADFILE}* oss://zhuamobbak/mysqlbak/3308/log_analyse/${TIMEDIR}/${FILENAME}_log_analyse_mysql.bz2python2.7

python2.7 /usr/bin/osscmd mkdir oss://zhuamobbak/mysqlbak/3308/wifiinfo/${TIMEDIR}
cd /home/danny/mysql_bak/wifiinfo
python2.7 /usr/bin/osscmd put ${UPLOADFILE}* oss://zhuamobbak/mysqlbak/3308/wifiinfo/${TIMEDIR}/${FILENAME}_wifiinfo_mysql.bz2cmd

python2.7 /usr/bin/osscmd mkdir oss://zhuamobbak/mysqlbak/3308/zmbox/${TIMEDIR}
cd /home/danny/mysql_bak/zmbox
python2.7 /usr/bin/osscmd put ${UPLOADFILE}* oss://zhuamobbak/mysqlbak/3308/zmbox/${TIMEDIR}/${FILENAME}_zmbox_mysql.bz2

io

本站公眾號
   歡迎關注本站公眾號,獲取更多信息