Filewatch

Filewatch is a small PHP script that keeps an eye on the files on your web site, and notifies you by email if any files are added, deleted or changed.

Because it runs on the server, the script is not limited to just checking web pages - it can also monitor hidden and system files in your hosting account.

There are several ways you can implement this script. For example, it can be run as a cron job, included invisibly in a web page, or just a standalone script that you manually check.

Filewatch has saved my bacon several times, by helping to identify changed files after a security exploit on clients' sites.

twzFilewatch
Version:

3.1.2

Licence:

GNU GPL

Requires:

PHP5+

Filename:

twzFileWatch-v312.zip

File date: 

2016-08-23


saman
Comment
twzfilewatch
Reply #1 on : Thu September 20, 2012, 01:58:30
Hi, Thank you for your Great script and i just have one question :
i use cron job to run twzfilwatch on my host
and set it Every 30 Minute .
Corn job send me email When finished.
i dont want to get this email every 30minute and then i use " >/dev/null' in cron command line .now cron dosent send me any email but when tzfiewatch deleted manually cron also doent send me any not found error . is there any way that cron stop sending normal finishig job email and just send email to me when tzwfilewatch file Not found.(i dont want to reacive cron notification every 5 or 30 minute and also if the hackers delete twzfilewatch i want to cron alert me that ).
tony
Comment
twzfilewatch
Reply #2 on : Thu September 20, 2012, 08:54:24
Hi saman
I don't think that is possible - you would need to setup another cron job that checks if twzFileWatch is there, and alerts you if not found.
tony
Comment
twzfilewatch
Reply #3 on : Fri September 21, 2012, 00:02:15
Saman kindly sent me the following solution he found:

Cronjob command line:

[ -f /home/public_html/filewatch.php ] && php /home/public_html/filewatch.php >/dev/null || echo "File Not Found At Server "

If filewatch.php exists, it is run without cron sending an email. If the script is not found, cron sends an email saying "File not found". I haven't tried this myself, but it looks like a neat solution.
Salvatore
Comment
Re: FileWatch
Reply #4 on : Tue December 01, 2015, 19:33:29
Hi, i have a problem with this script, I would like to exclude a folder from the scan, i added the option $FW->ExcludeFolders (array ('/home/account/public_html/wp-content/cache/ but when it is scanned, the folder is inserted into the txt file, so is present in the email report.
the directory root is:
$Check Folder='/home/account/public_html/';

thanks in advances

Salvatore
tony
Comment
FileWatch
Reply #5 on : Tue December 01, 2015, 21:51:56
Hi Salvatore

If you've done a previous scan and then later exclude a folder, the excluded folder will initially be reported as missing. The next and subsequent reports will not include the excluded folder.

Does that explain your situation?
Salvatore
Comment
Re: FileWatch
Reply #6 on : Tue December 01, 2015, 23:39:53
Ok, the script works, it was my mistake, sorry;
is possibile to add others directories?
tony
Comment
FileWatch
Reply #7 on : Fri December 04, 2015, 23:12:51
Hi Salvatore,
Do you mean how to check multiple directories? The second instantiation parameter ($CheckFolder or $TopFolder) is a string in the examples, but can also be an array with multiple directories.
Anonymous
Comment
Re: Filewatch
Reply #8 on : Thu July 23, 2020, 11:24:49
How to exclude a foloder watch inside a CheckFolder?
Thank you.
tony
Comment
Re: Anonymous
Reply #9 on : Thu July 23, 2020, 11:37:34
To exclude a folder, use the excludeFolders() method.

For example if CheckFolder is './public_html' then to exclude the images folder you would specify excludeFolders( array('./public_html/images') );
Anonymous
Comment
Re: Filewatch
Reply #10 on : Tue July 28, 2020, 14:08:53
I open twzFileWatch.php file
and add $fw-> excludeFolders( array('./public_html/images1','./public_html/images2') );
after
$fw = new twzFilewatch($SiteName, $CheckFolder, $RecurseLevel, $EmailTo);

Is this correct?
tony
Comment
Re: Anonymous
Reply #11 on : Tue July 28, 2020, 14:39:13
Yes, that looks right
Anonymous
Comment
Re:Tony
Reply #12 on : Wed July 29, 2020, 11:10:11
Thanks for your code.

Write a comment

  • Required fields are marked with *.