gcloud storage
(일반 가용성)은 Cloud Storage와 상호작용하는 데 권장되는 명령줄 도구입니다. 이 페이지에서는 두 도구 간의 주요 차이점과 명령어 매핑을 설명하여 gsutil
에서 gcloud storage
로 전환하는 데 도움을 줍니다. gcloud storage
도구의 자세한 설명은 gcloud storage
참조 문서를 참고하세요.
Google Cloud CLI를 설치하고 사용을 시작하는 방법을 알아보려면 Google Cloud CLI 설치를 참고하세요.
동작 차이
다음 섹션에서는 gsutil
와 gcloud storage
간의 동작 차이점을 설명합니다.
동시 호출
gcloud storage
는 서로 다른 터미널에서 CLI의 여러 인스턴스를 동시에 실행하는 것을 지원하지 않습니다.
병렬 처리
gcloud storage
은 병렬 처리를 지원합니다.
와일드 카드 처리
gcloud storage
에서는 별표 여러 개를 단순화합니다. 별표를 세 개 이상 연속으로 사용하면 (***
) 별표 하나 (*
)로 처리됩니다.
계층적 네임스페이스 버킷 처리
gcloud storage
을 사용하여 계층적 네임스페이스가 사용 설정된 버킷을 만들고 관리할 수 있습니다.
화면출력 형식
gcloud storage
및 gsutil
명령어는 출력을 다르게 형식화합니다.
로깅 형식과 같은 사소한 변경사항은 영향을 미치지 않을 수 있지만 오류 메시지와 데이터 목록의 더 큰 차이로 인해 자동 스크립트가 중단될 수 있습니다.
gsutil
명령어 출력을 파싱하는 스크립트가 있는 경우 전환하기 전에 gcloud storage
형식에 맞게 검토하고 업데이트해야 합니다.
gcloud 명령어에 상응하는 명령어
기존의 모든 gsutil
명령어는 gcloud storage
의 명령어와 동일하지만, 몇 가지 예외가 있습니다. 참조 문서에 방문하거나 gcloud storage --help
를 실행하여 gcloud storage
명령어의 전체 목록을 가져올 수 있습니다. 다음 표에는 자주 사용되는 gsutil
명령어의 변경사항이 간략하게 설명되어 있습니다.
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
액세스 제어 목록 (ACL) 관리 |
gsutil acl get gsutil acl set gsutil acl ch |
gcloud storage RESOURCE describe --format="multi(acl:format=json)" gcloud storage RESOURCE update --acl-file=ACL_FILE_PATH gcloud storage RESOURCE update --add-acl-grant=GRANT gcloud storage RESOURCE update --remove-acl-grant=GRANT |
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체를 연결하고 객체 콘텐츠 표시 |
gsutil cat |
gcloud storage cat |
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
새 객체로 결합하여 객체 연결 |
gsutil compose |
gcloud storage objects compose |
참고gcloud storage objects compose 에서 사전 조건을 적용하려면 --if-generation-match 또는 --if-metageneration-match 와 같은 특정 플래그를 사용하세요.
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체 및 기타 리소스 복사 |
gsutil cp |
gcloud storage cp |
참고 Google Cloud 콘솔을 사용하여 만든 시뮬레이션된 폴더는 0바이트 자리표시자 객체로 인식됩니다. 오류를 처리할 때 객체를 다운로드할 때 |
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체에서 사용한 총 디스크 공간 표시 |
gsutil du |
gcloud storage du |
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
파일 해시 계산 |
gsutil hash |
gcloud storage hash |
참고
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
버킷 라벨 관리 |
gsutil label get gsutil label set gsutil label ch |
gcloud storage buckets describe gcloud storage buckets update gcloud storage buckets update |
참고단일 |
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
버킷, 객체, 폴더 나열 |
gsutil ls |
gcloud storage ls |
참고와일드 카드를 사용하여 프로젝트의 객체를 나열하면
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체 또는 디렉터리 이동 및 이름 바꾸기 |
gsutil mv |
gcloud storage mv |
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체를 제자리에서 다시 작성 |
gsutil rewrite |
gcloud storage objects update |
참고boto 구성 파일에
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체 또는 버킷 삭제 |
gsutil rm |
gcloud storage rm |
참고
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
두 버킷 또는 디렉터리의 콘텐츠 동기화 |
gsutil rsync |
gcloud storage rsync |
참고기본적으로
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
업로드된 객체에 메타데이터 설정 |
gsutil setmeta |
gcloud storage objects update |
참고
|
작업 | gsutil 명령어 | gcloud storage 명령어 |
---|---|---|
객체 상태 표시 |
gsutil stat |
gcloud storage objects list --stat --fetch-encrypted-object-hashes |
참고
|
다음 단계
명령어 및 플래그 매핑에 관한 자세한 내용은 gsutil
GitHub 저장소의 이전 참조를 참고하세요.