2007. 11. 3. 21:09 Unix
cpio로 디렉토리 구조(tree) 복사하기
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
UNIX GURU UNIVERSE
UNIX HOT TIP
UNIX GURU UNIVERSE
UNIX HOT TIP
Unix Tip 2327 - May 16, 2006
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
cpio로 디렉토리구조(tree) 복사하기
표준 Unix tar를 사용하여 디렉토리구조를 복사하게 되면 원래의 복사하는 동안
디렉토리와 파일에 대한 소유자와 그룹정보를 보존하지 않는다.
이 정보를 보존하기 위해서 다음과 같은 방법으로 find(1)와 pipe를 통해
cpio(1)를 사용하라.
디렉토리와 파일에 대한 소유자와 그룹정보를 보존하지 않는다.
이 정보를 보존하기 위해서 다음과 같은 방법으로 find(1)와 pipe를 통해
cpio(1)를 사용하라.
% cd <원본 디렉토리>
% find . -depth -print | cpio -pudm <대상 디렉토리>
% find . -depth -print | cpio -pudm <대상 디렉토리>
이 명령은 <원본 디렉토리>의 디렉토리 구조에 대한 미러 이미지를 <대상 디렉토리>에
생성할 것이다.
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
생성할 것이다.
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@
COPY A TREE WITH CPIO
Using standard UNIX tar to copy a
tree doesn't preserve the original
owner and group information for the
directories and files during the copy.
To do this, use find(1) piped to cpio(1)
this way:
tree doesn't preserve the original
owner and group information for the
directories and files during the copy.
To do this, use find(1) piped to cpio(1)
this way:
% cd <source-directory>
% find . -depth -print | cpio -pudm <dest-directory>
% find . -depth -print | cpio -pudm <dest-directory>
This will create a mirror image of the
<source-directory> tree in <dest-directory>.
<source-directory> tree in <dest-directory>.
반응형