Posted on 2008/09/08 13:02
Filed Under [1] IT 관련/2. Linux

* 시나리오
- 웹호스팅을 이용하고 있습니다 (홈 디렉토리만 이용 가능한 조건이죠)
- 매일 홈디렉토리를 백업하고 싶습니다.
- 매일 tar로 백업하다보니 tar가 중복 백업됩니다.
- 그래서 이미 백업된 tar 파일은 빼고 나머지 순수한 홈페이지 파일들만 백업하고 싶을 때
  사용하면 좋습니다.
- 20050214와 같은 포맷을 얻기 위한 date 명령은 Shell 마다 조금씩 다릅니다.

---------------------------------< cut here >-----------------------------
#!/bin/sh
today=`date +%F` # BASH(Linux)
# today=`date +20"%y%m%d"` # C-Shell(AIX외)
find . -type f ! -name "*.tar" -print > ./flist
tar -cvpf $today-homepage.tar -L ./flist
---------------------------------< cut here >------------------------------

2008/09/08 13:02 2008/09/08 13:02

트랙백 주소 : http://jaehun.org/trackback/23

About

by Jaehun

Counter

· Total
: 51169
· Today
: 20
· Yesterday
: 100