Incremental BackUp tool written in [[Python]] http://www.nongnu.org/rdiff-backup/ [[Win32]]에서 사용하기 * [[http://katastrophos.net/andre/blog/?p=19|rdiff-backup on Windows]] * [[http://solutionsfirst.com.au/~dave/backup/|binaries]] 백업하기 {{{ rdiff-backup TARGET_DIR BACKUP_DIR rdiff-backup --remove-older-than 10D BACKUP_DIR # 10일 지난 파일들 삭제 rdiff-backup -r 3D BACKUP_DIR WANTED_DIR # 원하는 경로에 3일전 데이터 복구 }}} rdiff-bacup 과 django dump 를 이용한 백업 스크립트 backup.sh {{{ #!/bin/sh rdiff-backup /usr/local/dsite /home/agrims_backup/file rdiff-backup --remove-older-than 30D /home/agrims_backup/file /usr/local/bin/python /usr/local/dsite/manage.py dumpdata > /home/agrims_backup/db/dump_`date '+%Y%m%d.json'` 2>&1 /usr/local/bin/python /home/agrims_backup/remove_older_than_30day.py /home/agrims_backup/db 2>&1 }}} remove_older_than_30day.py {{{#!python #!/usr/local/bin/python import sys, os from datetime import date, timedelta target = sys.argv[1] for d in os.listdir(target): if d.startswith('dump_'): year = int(d[5:9]) month = int(d[9:11]) day = int(d[11:13]) file_date = date(year,month,day) if date.today() - file_date > timedelta(30): os.remove(os.path.join(target, d)) }}} ---- CategoryProgram