代码拉取完成,页面将自动刷新
同步操作将从 hxt168/mongodb_backup_script 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env
import fun
import time
import config
from oss.oss_util import *
import properties_util
if __name__ == "__main__":
start_time = time.time()
print("begin to dump mongodb database ...");
db_backup_dir=config.db_backup_root_path+config.db_backup_dir_name;
## backup mongodb to local
#fun.backup_mongodb(config.db_host, config.db_user, config.db_passwd, config.db_name, db_backup_dir)
print("begin zip files...")
db_backup_zip_name=config.db_backup_dir_name+".zip";
db_backup_zip=config.db_backup_root_path+db_backup_zip_name;
## zip
#fun.zip_files(db_backup_dir,db_backup_zip)
print("begin upload to oss...")
oss=fun.get_oss_connect(config.endpoint, config.accessKeyId, config.accessKeySecret);
## upload to oss
#fun.upload_file_to_bucket(oss,config.bucket,db_backup_zip,db_backup_zip_name)
#fun.upload_large_file_to_bucket(oss,config.bucket,db_backup_zip,db_backup_zip_name, 5)
db_backup_zip="H:\\pythoncode\\temp\\mongodb_cycle_backup_titan_20151120182050_full.zip"
db_backup_zip_name="mongodb_cycle_backup_titan_20151120182050_full.zip"
#fun.large_multi_upload_file(oss,config.bucket,db_backup_zip,db_backup_zip_name, config.upload_thread_num)
#fun.download_file_to_local(oss,config.bucket,db_backup_zip,db_backup_zip_name)
#fun.del_bucket_file(oss,config.bucket,"mongodb_backup_201511201758.zip")
#fun.del_dir_or_file("H:\\pythoncode\\temp\\mongodb_backup_201511031636.zip")
fun.print_cost_time("all done ", start_time)
#fun.list_bucket_files(oss,config.bucket)
p=properties_util.Properties("config.properties")
print os.path.split(os.path.realpath(__file__))[0];
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。