Skip to content

Commit

Permalink
Expand include parameter to apply to downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
alfpark committed Dec 4, 2015
1 parent 01968a8 commit e21dd56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Python/Storage/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ pattern, an example commandline would be:

::

blobxfer.py mystorageacct container0 mylocaldir --upload --include **/*.txt
blobxfer.py mystorageacct container0 mylocaldir --upload --include '**/*.txt'

This would attempt to recursively upload the contents of mylocaldir
to container0 for any file matching the wildcard pattern ``*.txt`` within
all subdirectories.
all subdirectories. Include patterns can be applied for uploads as well as
downloads. Note that you will need to prevent globbing in your shell such
that wildcard expansion does not take place before script interprets the
argument.

To download an entire container from your storage account, an example
commandline would be:
Expand Down Expand Up @@ -229,6 +232,11 @@ General Notes
occurs prior to any transfers, analogous to the delete-before rsync option.
Please note that this parameter will interact with ``--include`` and any
file not included from the include pattern will be deleted.
- ``--include`` has no effect when specifying a single file to upload or
blob to download. When specifying ``--include`` on container download,
the pattern will be applied to the blob name without the container name.
Globbing of wildcards must be disabled such that the script can read
the include pattern without the shell expanding the wildcards, if specified.

Performance Notes
-----------------
Expand Down
4 changes: 4 additions & 0 deletions Python/Storage/blobxfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,10 @@ def main():
created_dirs.add(args.localresource)
# generate xferspec for all blobs
for blob in blobdict:
# filter results
if args.include is not None and not fnmatch.fnmatch(
blob, args.include):
continue
if args.collate is not None:
localfile = os.path.join(
args.localresource, args.collate, blob)
Expand Down

0 comments on commit e21dd56

Please sign in to comment.