본문 바로가기
GCP

GCS(Google Cloud Storage)

by misankim 2023. 5. 12.

GCS(Google Cloud Storage)

 

 

# google cloud storage

-> Same as s3 in aws

 

 

# Bucket storage class and s3 storage class

 

Standard - Standard

Nearline - Standard-Infrequent Access

Coldline - One Zone-Infrequent Access

Archive - Glacier

 

 

# gsutil

-> cli command for google cloud storage

-> Installed together with cloud SDK installation

 

 

# Command example

 

Check bucket list

gsutil list

 

Check the object list in the bucket

 

gsutil ls gs://premisan-test/

 

Copy object to bucket

 

gsutil cp pink-flowers-on-trees-981364.jpg gs://premisan-test/

 

Check object details in a bucket

 

gsutil ls -L gs://premisan-test/pink-flowers-on-trees-981364.jpg

 

Deleting objects in a bucket

 

gsutil rm gs://premisan-test/pink-flowers-on-trees-981364.jpg

 

Check bucket capacity

 

gsutil du -sh gs://premisan-test/

 

Create bucket

 

gsutil mb gs://버킷_이름

 

Delete Bucket

 

gsutil rb gs://버킷_이름

 

 

# Bucket/Directory Sync

 

Sync

gsutil rsync test123 gs://premisan-test/test123

 

Sync to subdirectories

 

gsutil rsync -r test123 gs://premisan-test/test123

 

multi-threaded sink

 

 gsutil -m rsync -r test123 gs://premisan-test/test123

 

Sync by deleting files that do not match.

 

gsutil rsync -d -r gs://premisan-test/test123 my-test123

 

Sync by deleting unmatched files (dry-run)

gsutil rsync -d -r -n gs://premisan-test/test123 my-test123

 

Sync data between buckets

 

gsutil -m rsync -r -d gs://premisan-test/test123 gs://my-test-bucket

 

Sink data from cloud storage bucket to aws s3 bucket

 gsutil rsync -d -r gs://my-gs-bucket s3://my-s3-bucket

 

'GCP' 카테고리의 다른 글

Create GCP Internal TCP Proxy LB  (0) 2023.05.12
gcsfuse  (0) 2023.05.12
Cloud Functions 에서 VPC 내부 리소스 접근  (0) 2023.05.12
GCE Alias IP address  (0) 2023.05.06
GCE(Google Compute Engine) Windows OS 라이센스 인증  (0) 2023.05.06