linuxsynchronizationcopygoogle-cloud-storagegsutil

Is it possible to copy local files to a bucket while skipping files that exist both in the bucket and locally with gsutil?


I want to sync a local directory to a bucket in Google Cloud Storage. I want to copy the local files that do not exist remotely, skipping files that already exist both remote and local.

Is this possible to do this with GSUtil?

I can't find a "sync" option for GSUtil or a "do not overwrite". Is it possible to script this?

I am on Linux (Ubuntu 12.04)?


Solution

  • gsutil supports the noclobber flag (-n) on the cp command. This flag will skip files that already exist at the destination.