Tuesday, 25 June 2013

Copy files in a directory tree matching pattern(s) while preserving the relative path

Have you ever wanted to copy all files of a certain type from a large directory tree to an identical directory tree?

For example, one time I needed to copy all the .so files from /var/lib/gems to the vendor directory because for some reason, dependencies didn't. Copying all files didn't appeal to me, so I made this script.

Why I will not sign an NDA

I do appreciate people contacting me about a business idea they have where they need the help of an experienced software architect or database specialist. However so many non-tech people keep asking for NDAs, and often so after writing only one sentence (or less) about what the project is about. Because this happens more than once, I'll do what any serious developer would do - write a script to automate it. So here's my automated reply: