PDA

View Full Version : Excluding files by pattern


mike
03-20-2009, 09:58 PM
When I am backing up, I would like to exclude files and folders that match certain patterns:

.DS_Store
*~
*.bak
*.tmp
build (a folder name)
etc.


The script command Item Specification seems to require an absolute path from the root, though. Is there a way to specify a file pattern that will be matched wherever it occurs?

If not, could that feature be added? It would be very useful.

dnanian
03-20-2009, 11:29 PM
No. Of course, you can use wildcards at any given folder level -- e.g.

*/*/*/*.bak

mike
03-21-2009, 01:18 AM
Ah... So if I create a rule file called "exclude backup files" that rejects

ignore *.bak
ignore */*.bak
...
ignore */*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*.bak


and include it in a new copy script, then in that script I say to

copy Projects


Will the file Projects/MyProject/MyFile.txt.bak be included or excluded?

dnanian
03-21-2009, 07:22 AM
It should be ignored.