User Tools

Site Tools


svn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
svn [2009/08/12 06:46] suapapasvn [2013/08/03 05:04] (current) – external edit 127.0.0.1
Line 6: Line 6:
 </code> </code>
 ====== backup/restore ====== ====== backup/restore ======
-덤프떠서 보내기 +덤프 스크립트 
-<code bash+<code python
-svnadmin dump /path/to/repo > dumpname.dump ; scp -rp dumpname.dump user@server.domain.com:/tmp/+#!/usr/bin/python 
 +import os, sys 
 + 
 +def main(rootDir): 
 +    print os.path.realpath(rootDir) 
 +    repolist = os.listdir(rootDir) 
 +    repolist = map(lambda x:os.path.join(rootDir, x), repolist) 
 +    print repolist 
 +    repolist = filter(os.path.isdir, repolist) 
 +    print repolist 
 + 
 +    dumplist = [] 
 +    for repo in repolist: 
 +        print '='*80 
 +        print '  %s dump start'%repo 
 +        dumpName = '%s.dump'%os.path.basename(repo) 
 +        print 'svnadmin dump %s %s'%(repo, dumpName) 
 +        ret = os.system('svnadmin dump %s > %s'%(repo, dumpName)) 
 +        if ret == 0: 
 +            dumplist.append(dumpName) 
 +        else: 
 +            sys.exit(1) 
 +    if not dumplist: 
 +        print 'no dump found' 
 +        sys.exit(1) 
 +    print 'now making tar archive' 
 +    os.system(r'tar czvf suapapa_svndumps_`date +%Y%m%d`.tgz '\ 
 +            +(' '.join(dumplist))) 
 + 
 +if __name__ == '__main__': 
 +    main(sys.argv[1])
 </code> </code>
 복구 복구
svn.1250059587.txt.gz · Last modified: 2013/08/03 05:04 (external edit)