넷백업은 각 폴리시 별로 백업 대상디렉토리가 정해지는데
아래와 같은 코드를 사용하면 각 폴리시에서 어떤 폴더들이 백업대상 폴더로 세팅되었는지 알수 있다.
def get_policy_list():
lines=commands.getoutput('bppllist').split('\n')
return lines
def get_include_dir(policies):
backup_target={}
print policies
for policy in policies:
if policy != 'ORACLE_ARCHIVE':
dirs=[]
includes=commands.getoutput('bpplinclude %s -L'% policy).split('\n')
for include in includes:
dir=(include.split(':')[-1]).strip()
dirs.append(dir)
if( dirs.count('CATALOG_DRIVEN_BACKUP') == 0):
backup_target[policy]=dirs
else:
pass
for line in backup_target.keys():
print line,backup_target[line]
policies=get_policy_list()
get_include_dir(policies)
'PYTHON > CODE' 카테고리의 다른 글
[CODE] MySQLdb select 예제 (0) | 2012.11.01 |
---|---|
[CODE] PYTHON SSH 접속 작업하기 (1) | 2012.10.19 |
[CODE] 파이썬 소켓 프로그래밍 (0) | 2012.10.19 |
[CODE] 파이썬 외부 명령어 설행(subprocess) (0) | 2012.10.04 |
[CODE] 파이썬 외부 명령어 설행(os.system) (0) | 2012.10.04 |