Compare the files in 2 different servers for change or modification

I have the following requirement;

  • I need to compare set of files in 2 different servers A and B.
  • Both have same sets of files and directory structure
  • First I need to move the files from Server A to server B
  • Compare the corresponding file in B server and see if it has modified (not concerned on the size)
  • If it has changed, then I need to send an email to the stakeholder that it has changed.

Any suggestions on how do I acheive this? Thanks.

you could accomplish this without having to copy the files. create a checksum with an md5 utility or similar and then compare the hashes.