Script to echo "File permissions or ownership changed from required " when accidentally changed.

Hi All,

I have to work in the late nights some times for server maintenance and in a hurry to complete I am accidentally changing ownership or permission of directories :frowning:
which have similar names ( /var in root and var of some other directory ).:confused:

Can some one suggest me with the logic or already available script by which the change in ownership or permission of a directory can be tracked from previous state..:wall:

Man Page for mtree (all Section 8) - The UNIX and Linux Forums

Regards,
Alister