Skip to content

Excluding files from upload

John Bradley edited this page Oct 11, 2017 · 8 revisions

.ddsignore files limit what is uploaded

Users can limit what is uploaded from a folder by creating a file named .ddsignore. This file contains a list of file/folder patterns that should be excluded. These patterns are only applied on files/folders within the folder the .ddsignore file is contained.

Each line in a .ddsignore file specifies a pattern.

These patterns follow the python fnmatch Unix shell-style wildcards.

Special characters used in shell-style wildcards:

Pattern	Meaning
*	matches everything
?	matches any single character
[seq]	matches any character in seq
[!seq]	matches any character not in seq

Important distinction from standard unix shell matching python fnmatch:

Note that the filename separator ('/' on Unix) is not special to this module. ... Similarly, filenames starting with a period are not special for this module, and are matched by the * and ? patterns.

Using the --dry-run option with upload command can help you test out what will be uploaded while creating .ddsignore files.

Examples

Skip files that end in a particular extension

Given a project with this layout:

project1/
project1/data/
project1/data/file1.log
project1/data/file2.zip
project1/data/file3.bam
project1/somefile.log

Uploaded with a command like this:

ddsclient upload -p MyProject1 project1/

Create a file at project1/.ddsignore with the following contents:

*.log

This would skip uploading these files:

project1/data/file1.log
project1/somefile.log

If the .ddsignore file was moved to project1/data/.ddsignore only project1/data/file1.log would be skipped.

Skip files contained in particular folders

Given a project with this layout:

project2/
project2/data/
project2/data/backup.zip
project2/data2/
project2/data2/backup.zip

Create a file at project2/.ddsignore with the following contents:

data2/*.zip

This would skip uploading these files:

project2/data2/backup.zip

The project2/data/backup.zip file would still be included.

Skip folders

Given a project with this layout:

project2/
project2/partA/
project2/partA/save/
project2/partA/save/backup.zip
project2/partB/
project2/partB/save/
project2/partB/save/backup.zip

Create a file at project2/.ddsignore with the following contents:

save/

This would skip uploading these items:

project2/partA/save/
project2/partA/save/backup.zip
project2/partB/save/
project2/partB/save/backup.zip