Oracle8I数据库冷备份的恢复
2011-12-27 00:07
453 查看
#!/usr/bin/env python '''This script is used for backup directorys. you can backup a directory at a time,and also you can backup multiple directorys at a time. ''' import tarfile import os import sys # # the following lines is used to process the directorys # to be backed up # dirs_src = raw_input('Enter directorys that which you want to backup: ') if dirs_src == '': sys.exit('you should enter at least one directory') dirs_src = dirs_src.replace(',', ' ').split(' ') for judge in dirs_src: if os.path.isfile(judge): sys.exit('%s is not a directory' % judge) dirs = [] for d in dirs_src: dirs.append(d.rstrip('/')) # # the following lines is used to process the directory # to be placed # dest = raw_input('Enter storage path: ') if dest == '': sys.exit('you should input a storage path') if not os.path.exists(dest): os.makedirs(dest) if dest[-1] == '/': pass else: dest = dest+'/' # # backup section # for dir in dirs: if os.path.exists(dir): tar_name = dir.lstrip('/').replace('/', '-') os.chdir(dir) print dir+' backup is beging...' files = [n for n in os.listdir(dir)] tar = tarfile.open('%s%s.tar.gz' % (dest,tar_name),'w:gz') for name in files: tar.add(name) tar.close() print dir+' backup finished' else: print 'There is no directory called '+ dir
本文出自 “永不止步” 博客,请务必保留此出处http://wjcaiyf.blog.51cto.com/7105309/1690833
相关文章推荐
- Oracle 数据库的备份与恢复
- oracle 备份与恢复1-数据库数据与文本文件
- oracle备份恢复数据库
- Oracle® 数据库备份恢复基础--3.5为RMAN设置闪回恢复区
- 如何在oracle中导入导出(备份&恢复)dmp数据库文件
- ORACLE 11G 中采用rman备份异机恢复数据库详细过程
- Oracle10g数据库备份与恢复总结6--Oracle备份与恢复之数据库闪回技术
- 数据库的备份与恢复(oracle 11g)
- 十二、oracle 数据库(表)的逻辑备份与恢复
- 数据库的备份与恢复(oracle 11g) (转)
- Oracle 数据库、表、方案的逻辑备份与恢复
- Oracle数据库的备份与恢复
- Oracle完全攻略---数据库备份与恢复
- 傻瓜式实战Oracle 10g RMAN之数据库备份和恢复
- oracle 备份数据库 恢复数据库(导入已备份的数据) 用户级别
- Oracle备份恢复之数据库备份、还原、恢复理论
- Oracle之用户管理(了解)及数据库的备份与恢复(了解)
- Oracle 数据库的备份与恢复命令
- Oracle的常用命令之备份和恢复数据库
- Oracle 数据库(表)的逻辑备份与恢复