Wednesday, October 26, 2016

Checking wether a file exists or not in a Google Cloud Storage bucket using "gsutil"

This answer solved my problem:

gsutil -q stat gs://bucket/file

If this command returns 0 (false), the file does not exist at all.
If this command returns non-zero (true), the file already exists.


Gsutil - How can I check if a file exists in a GCS bucket (a sub-directory) using Gsutil

No comments:

Post a Comment