#!/bin/bash
#########################################
#Usage: upload_OSS.sh
#Author: Danny
#Company: BPO Solutions
#Version: 1.0
#########################################
UPLOADFILE=$(date +%Y-%m-%d)
TIMEDIR=$(date +%Y%m)
FILENAME=$(date +%Y-%m-%d-%H-%M)
#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.bz2
#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.bz2
#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.bz2
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.bz2
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