tar을 이용한 간단한 백업스크립트

특정 디렉토리를 원하는 디렉토리로 압축백업. /etc/cron.daily 에 스크립트로 넣어주면 하루에 한번씩 실행 되면서 백업한다. 생성된지 30일이 지난 백업은 스크립트에 의해 삭제된다. #!/bin/bash sysdtime=`date +%Y%m%d` hostname=’호스트명’ tar -czpf /[백업이 보관될 디렉토리]/$hostname-$sysdtime.tar.gz /[백업할 디렉토리] find /[백업이 보관될 디렉토리] -ctime +30 -exec rm Continue reading tar을 이용한 간단한 백업스크립트