#3 Checking for Changed Files

Sometimes it's useful to figure what files have changed on your system. For example, you might want to know what a software upgrade actually touched. Other times you want to make sure that files on your system don't change. For example, system-critical configuration files or commands should remain intact. Changes in these files can indicate that your system has been hacked.

This script checks a filesystem and reports any changes made since the last time it was run.

The Code

 1 use strict; 2 use warnings; 3 use File::Find; 4 use Digest::MD5; 5 use Storable qw(nstore retrieve); 6 7 # File in which to store the change information 8 my $info_file_name = ".change.info"; 9 10 ######################################################## ...

Get Wicked Cool Perl Scripts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.