Check that 2 directories are the same

I need to make a copy of a directory keeping ownership, dates and links for all files intact. For that I'm using tar. Then I have to verify that the new directory and the old one are exactly the same (requirement is that the sums of all files are the same). The directory has many subdirectories and directories within directories, so just doing a sum of an ls command is not working...
Can someone point me in the right direction?

Thanks! :

here's one way:

/you/are/in/original-dir$ md5sum `find . -type f` > /tmp/original.md5s
/path/to/copy/of/original-dir$ md5sum `find . -type f` > /tmp/new.md5s
/tmp$ diff ./original.md5s ./new.md5s

Hope this helps!

Thanks! That's what I needed :slight_smile:

I've said it so many times, rsync is an excellent syncing program.