How To Monitor File Changes On Shared Host (and receive email alerts)


New Member
I am a new KnownHost managed reseller hosting customer.

I am moving from another hosting provider that I had been with a while but lacked some important features like SSH and SFTP. I had repeated problems with malware on even simple sites that hosted nothing but static html content and images.

The way I cleaned up the sites was by downloading the content to a local pc and using programs like WinMerge and MultiHasher to compare files against a known good backup and removing files that seemed malicious or that I knew I had not added. To my surprise, many of the suspicious files were years old, indicating that the sites had been compromised for a while.

This brings me to my question: How can I have files and directories on my shared host regularly monitored and receive an email alert when files or folders changes? Catching changes early on can help prevent widespread damage and allow me to identify areas where security needs to be hardened.

What scripts do you all use or recommend for File Integrity Monitoring on a shared host on KnownHost? I was hoping to run a script as a cron job that has the options to:
1.) monitor and recursively process directories,
2.) exclude specified directories (e.g. logs, etc.),
3.) uses checksum hashes to compare files, and
4.) send a report via email of anything that has changed (or that no changes have been detected).