Parallel Works

pw buckets cp

pw buckets cp

Copy files between local and buckets

Synopsis

The pw buckets cp command must be followed by a source and a destination. The source and destination can be either a local file or a bucket URI.

Both PW URIs and CSP URIs are accepted. For more information about URIs, please see this section.

When copying to/from a bucket with a PW URI, you must specify at least the bucket name. However, paths can be longer, such as pw://[namespace]/[bucket-name]/[folder]/[folder2]/[folder3]/[file-name].

Recursive copies follow the same trailing slash rule as cp and rsync: a source without a trailing slash copies the directory itself, and a source with a trailing slash copies its contents. This holds in both directions.

pw buckets cp [source] [destination] [flags]

Examples

  pw buckets cp sample.txt pw://demo/demos3bucket
  
  # Download a file named sample.txt to a local file
  pw buckets cp pw://demo/demos3bucket/sample.txt sample2.txt
  
  # Download a file from Azure Blob Storage to a local folder, using the Azure URI
  pw buckets cp https://azuredemo.blob.core.windows.net/azuredemo/sample.txt sample2.txt
  
  # Recursive download of a folder, keeping the folder
  # Result: ./downloads/sample-dir/a.txt, ./downloads/sample-dir/sub/b.txt, ...
  pw buckets cp -r pw://demo/demos3bucket/sample-dir ./downloads
  
  # Recursive download of a folder's contents, with a trailing slash
  # Result: ./downloads/a.txt, ./downloads/sub/b.txt, ...
  pw buckets cp -r pw://demo/demos3bucket/sample-dir/ ./downloads
  
  # Recursive download of the entire bucket root into a local folder
  # Result: ./downloads/<all objects from bucket root...>
  pw buckets cp -r pw://demo/demos3bucket ./downloads/
  
  # Recursive upload of a folder, keeping the folder
  # Result: pw://demo/demos3bucket/uploads/sample-dir/a.txt, ...
  pw buckets cp -r ./sample-dir pw://demo/demos3bucket/uploads
  
  # Recursive upload of a folder's contents, with a trailing slash
  # Result: pw://demo/demos3bucket/uploads/a.txt, ...
  pw buckets cp -r ./sample-dir/ pw://demo/demos3bucket/uploads

Options

  -h, --help        help for cp
  -r, --recursive   Copy directories/prefixes recursively

Options inherited from parent commands

      --context string         The context to use. Overrides PW_CONTEXT environment variable and current context from config.
      --platform-host string   The Parallel Works ACTIVATE platform host to use. Will override any other platform host settings.
  -v, --verbose                Enable verbose logging

SEE ALSO