태그 보관물: tar

tar

이미 작성된 tar 아카이브를 어떻게 확인합니까? 만들 때 -W를 수행 할

보관 파일을 만들 때 -W를 수행 할 수 있지만 보관 파일을 확인하고 이미 만든 방법은 무엇입니까? tvWf는 유효한 tar 아카이브가 아니라고 말합니다.

$ mkdir tmp
$ echo asdkfjh > tmp/a
$ echo qweroiu > tmp/b
$ ls
tmp
$ tar cvf archive.tar tmp
tmp/
tmp/a
tmp/b
$ tar tvWf archive.tar
tar: This does not look like a tar archive
tar: Skipping to next header
tar: VERIFY FAILURE: 1 invalid header detected
tar: Error exit delayed from previous errors

tar 1.15 (centos 5의 시스템 기본값)와 1.26 (gnu의 최신 버전) 모두에서 동일한 상황이 발생합니다.



답변

W와 함께 사용할 수 없습니다 t.

mkdir tmp
echo bdb > tmp/a
echo bdb > tmp/b

tar cvf archive.tar tmp
tmp/
tmp/a
tmp/b

ls -l archive.tar
-rw-r--r-- 1 tony tony 10240 Jun 23 05:57 archive.tar

tar tvf archive.tar
drwxr-sr-x tony/tony         0 2011-06-23 05:57 tmp/
-rw-r--r-- tony/tony         4 2011-06-23 05:57 tmp/a
-rw-r--r-- tony/tony         4 2011-06-23 05:57 tmp/b

tar tvWf archive.tar
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

나는 t혼자서 아카이브를 테스트하기에 충분 하다고 생각 합니다.


답변

GNU tar에는 --compare옵션이 있습니다. 자세한 내용은 문서 의 파일 시스템과 아카이브 멤버 비교 섹션을 참조하십시오.


답변

Joerg Schillings 는 tar 아카이브의 파일을 원본과 비교할 수 star있는 diff 옵션을 제공합니다. 차이점으로 인식해야 할 사항을 진술 할 수 있습니다.

0 1 newt pts/1 ~ 17> :> tmp/testfile
0 1 newt pts/1 ~ 19> star -cz tmp > tmp.tar
0 1 newt pts/1 ~ 19> echo bla > tmp/testfile
0 1 newt pts/1 ~ 20> star -z -diff diffopts=not,times < tmp.tar
diffopts=perm,symperm,type,nlink,uid,gid,uname,gname,size,data,rdev,hardlink,symlink,sympath,sparse,dir,acl,xattr,fflags
tmp/testfile: different size,data
star: 115 blocks + 0 bytes (total of 1177600 bytes = 1150.00k).

testfile크기와 데이터가 다른 것으로 언급 했습니다. 시간 (접근 시간 포함)을 제외하지 않았다면 액세스 시간도 명시했을 것이고 시간을 변경하여 파일을 보는 모든 파일도 나열했을 것입니다.

BerliOS의 소멸 이후, sourceforgestar 에서 찾을 수 있습니다 . 휴대 성이 뛰어나고 대부분의 유닉스 시스템과 유닉스 모양의 모양에서 고통없이 컴파일됩니다.


답변