#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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.