Question: We need a script that will compare two directories of files and for each file that has been altered between directory 1 and directory 2 (added, deleted, modified), need to create a subset of only those modified files.

My first impression is to create a python script to traverse each directory, compute a hash of each file, and if the hash has changed, copy the file over to the new subset of files. Is this a proper approach? Am I neglecting any tools out there which may do this already? I've never used it, but maybe use something like [rsync](http://rsync.samba.org/) could be used?

Thanks

**Edit:**

The important part is that I am able to compile a subset of only those files were changed-- so if a only 3 files have changed between versions, I only need those three files copied to a new directory...

Answer: 
That is one completely reasonable approach, but you are essentially reinventing rsync. So yes, use rsync.

**edit**: [There's a way to create "difference-only" folders using `rsync`](http://lists.samba.org/archive/rsync/2006-June/015827.html)
I like [diffmerge](http://www.sourcegear.com/diffmerge/), it works great for this purpose.