rsync --compress-level : 어떤 압축 수준을 사용할 수 있습니까?


13

Rsync에는 압축을위한 명령 줄 인수가 있습니다.

-z, --compress              compress file data during the transfer
    --compress-level=NUM    explicitly set compression level

무슨 --compress-level뜻입니까? 어떤 숫자를 레벨로 사용할 수 있습니까?

답변:


16

0-9 사이의 값입니다. 1이 가장 빠른 곳에서 9가 가장 많이 압축됩니다. 그 외에는 rsync와 zlib 사이에 상관 관계가 있으며, 여기서 rsync는 zlib 라이브러리가 zlib 라이브러리에서 "기본 압축 사용"을 지시합니다.

Z_DEFAULT_COMPRESSION은 속도와 압축 (현재 레벨 6과 동일)간에 기본 절충을 요청합니다.


자,이 레벨의 기원은 zlib입니까?
— cronfy

예, 그러나 rsync 0과 같이 값을 설정하면 압축되지 않은 다음 해당 형식으로 보낼 수 있습니다.
— Michal

0

사용되는 환경은 MACVLAN과 함께 사용되는 두 개의 도커 컨테이너 + 일부 소음 트래픽 (약 ± 1 % 오류 발생)으로 구성되었습니다. 필자의 경우 fileX는 이진 파일입니다.

따라서 아래는 rsync tarred 파일과 압축을 사용하는 rsync (옵션 -z) untarred 파일의 결과입니다.

      1. File tarred + rsync without compression (rsync -axvPAH fileX.tar destination:/path)

    File size is 56933 bits (fileX.tar)
    Transfer difference is 4735665-4673346=62319 bits

      2. File tarred + rsync with default compression (rsync -axvPAH -z fileX destination:/path)

    File size is 56933 (fileX.tar)
    Transfer difference is 4933845-4871608=62237

      3. File tarred + rsync with maximum compression (rsync -axvPAH -z --compress-level=9 fileX.tar destination:/path)

    File size is 56933 bits (fileX.tar)
    Transfer difference is 4870664-4808387=62277

      4. File untarred + rsync with default compression (rsync -axvPAH -z fileX destination:/path)

    File size is 237525 bits (fileX)
    Transfer difference is 4669946-4607637=62309 bits

      5. File untarred + rsync with maximum compression (rsync -axvPAH -z --compress-level=9 fileX destination:/path)

    File size is 237525 bits (fileX)
    Transfer difference is 4806735-4744764=61971 bits

      6. File untarred + rsync without compression (makes no sense since it’s the most bandwidth consuming one) 
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.