zip file permission
글을 쓴날: 2020-09-03
원래 tar는 permission을 그대로 가지고 묶고 zip은 permission을 포함하지 않고 압축을 했음.
하지만 info-ZIP 3.0 부터 file/dirs UNIX permission과 UID/GID 소유권을 포함 할 수 있게 되었음. unix와 Windows NT에서는 보존하여 압축, 압축 해제 가능하나 Windows에서는 불가능함.
unzip의 관련 내용
https://unix.stackexchange.com/questions/313656/preserving-permissions-while-zipping
Dates, times and permissions of stored directories are not restored except under Unix. (On Windows NT and successors, timestamps are now restored.)
-
permission 포함 압축 및 해제 옵션은 없어도 기본 적용
root에서 진행하기를 권장함
추가로 SUID/SGID/Sticky bits 까지 복원하려면 -K 옵션 사용
zip xxxx.zip {files} unzip xxxx.zip -d {Target Dir}
comments powered by Disqus