-n No-clobber. When specified, existing files or objects at the
destination are not replaced. Any items that are skipped
by this option are reported as skipped. gsutil
performs an additional GET request to check if an item
exists before attempting to upload the data. This saves gsutil
from retransmitting data, but the additional HTTP requests may make
small object transfers slower and more expensive.
Detailed design
as explained in copyFile.js example: the request to copy is aborted if the object's generation number does not match your precondition. So, we can simply set ifGenerationMatch to 0 to copy files that are not in the destination bucket
TL;DR
support no-clobber copying, as the gsutil does:
Detailed design
as explained in copyFile.js example:
the request to copy is aborted if the object's generation number does not match your precondition
. So, we can simply setifGenerationMatch
to0
to copy files that are not in the destination bucketAdditional information
No response