download

Prev Next

Classic/VPC 환경에서 이용 가능합니다.

컨테이너(버킷)의 오브젝트를 다운로드합니다.

구문

download 구문은 다음과 같습니다.

  • 어카운트(전체 컨테이너 및 오브젝트 다운로드)

    swift download \
        --all \
        [--marker <marker>] \
        [--prefix <prefix>] \
        [--remove-prefix] \
        [--output-dir <out-directory>] \
        [--object-threads <threads>] \
        [--container-threads <threads>] \
        [--no-download] \
        [--skip-identical] \
        [--ignore-checksum] \
        [--ignore-mtime] \
        [--no-shuffle] \
        [--header <header:value>]
    
  • 컨테이너(컨테이너 내 전체 오브젝트 다운로드)

    swift download \
        <container> \
        [--marker <marker>] \
        [--prefix <prefix>] \
        [--remove-prefix] \
        [--output-dir <out-directory>] \
        [--object-threads <threads>] \
        [--container-threads <threads>] \
        [--no-download] \
        [--skip-identical] \
        [--ignore-checksum] \
        [--ignore-mtime] \
        [--no-shuffle] \
        [--header <header:value>]
    
  • 오브젝트(단일 또는 다중 오브젝트 다운로드)

    swift download \
        <container> <object> [<object> ...] \
        [--output <out-file>] \
        [--output-dir <out-directory>] \
        [--object-threads <threads>] \
        [--no-download] \
        [--skip-identical] \
        [--ignore-checksum] \
        [--ignore-mtime] \
        [--header <header:value>]
    

옵션

download 실행 시 지정할 수 있는 옵션을 설명합니다.

필수 옵션

download의 필수 옵션입니다.

옵션 타입 필수 여부 설명
<container> String Conditional 컨테이너 이름
  • --all 미입력 시 필수 입력
--all Boolean Conditional 어카운트의 모든 오브젝트 다운로드
  • <container> 미입력 시 필수 입력

선택 옵션

download의 선택 옵션입니다. 지정하지 않은 옵션에는 기본값이 적용됩니다.

옵션 타입 필수 여부 설명
<object> List Optional 오브젝트 이름
  • 공백으로 구분하여 여러 개 입력 가능
  • 미입력 시 컨테이너의 모든 오브젝트 다운로드
--prefix String Optional 지정한 접두사로 시작하는 항목만 다운로드
--remove-prefix Boolean Optional 접두사를 제외한 이름으로 저장
  • --prefix와 함께 사용
--marker String Optional 컨테이너 또는 어카운트 다운로드를 시작할 기준 위치
--output String Optional 단일 파일 다운로드 시 저장할 파일 경로
  • - 입력 시 표준 출력으로 전달
--output-dir String Optional 오브젝트를 저장할 디렉터리
  • 미입력 시 현재 디렉터리에 저장
  • 오브젝트를 하나만 지정한 경우 사용 불가(--output 사용)
--no-download Boolean Optional 다운로드를 수행하되 디스크에 저장하지 않음
--skip-identical Boolean Optional 로컬 파일과 오브젝트가 동일한 경우, 다운로드하지 않음
--ignore-checksum Boolean Optional 다운로드 시 체크섬 검증 비활성화
--ignore-mtime Boolean Optional X-Object-Meta-Mtime 헤더를 무시하고 새로운 시간 정보로 저장
--no-shuffle Boolean Optional 오브젝트 저장소에 나열된 순서대로 다운로드
  • 미입력 시 임의 순서로 다운로드
--object-threads Integer Optional 오브젝트 다운로드에 사용할 스레드 수
  • 기본값: 10
--container-threads Integer Optional 컨테이너 다운로드에 사용할 스레드 수
  • 기본값: 10
--header String Optional 다운로드 요청에 사용할 사용자 정의 헤더
  • header:value 형식으로 입력
  • 반복 입력 가능

공통 옵션

swift 명령에서 공통으로 사용하는 옵션에 대한 정보는 Archive Storage 옵션을 참조해 주십시오.

예시

명령을 실행하면 다운로드한 오브젝트 이름과 소요 시간 정보가 출력됩니다.

명령

오브젝트 하나를 다운로드하는 명령 예시는 다음과 같습니다.

swift download test-container-01 sample.txt

접두사로 필터링하여 저장 디렉터리를 지정하고 동일한 파일은 건너뛰는 명령 예시는 다음과 같습니다.

swift download test-container-01 \
    --prefix docs/ \
    --output-dir ./download \
    --skip-identical

어카운트의 모든 오브젝트를 순서대로 다운로드하는 명령 예시는 다음과 같습니다.

swift download \
    --all \
    --no-shuffle

출력

오브젝트 하나를 다운로드하는 출력 예시는 다음과 같습니다.

sample.txt [auth 0.000s, headers 0.109s, total 0.109s, 0.000 MB/s]

접두사로 필터링하여 다운로드하는 출력 예시는 다음과 같습니다.

./download/docs/report.txt [auth 0.000s, headers 0.071s, total 0.071s, 0.000 MB/s]

어카운트의 모든 오브젝트를 다운로드하는 출력 예시는 다음과 같습니다.

test-container-01/renamed.txt [auth 0.000s, headers 0.129s, total 0.129s, 0.000 MB/s]
test-container-01/sample.txt [auth 0.000s, headers 0.132s, total 0.132s, 0.000 MB/s]
test-container-01/large.bin [auth 0.000s, headers 0.236s, total 0.372s, 14.090 MB/s]