start readme. adapt to sanoid style snaps

master
Harold Paulson 2021-03-16 21:58:15 -07:00
parent 621e821cca
commit 7042522796
2 changed files with 17 additions and 11 deletions

View File

@ -0,0 +1,12 @@
#vhost-audit Web app
Check websites for file alterations in ZFS snapshots.
##Install
cd /www/test.clem.sierraweb.com/htdocs/
git clone git@gitea.sierraweb.com:haroldp/vhost-audit.git
cd vhost-audit
chmod 755 bin/*.pl
echo "/www/clementinebakery.com/htdocs" > sites.txt
./bin/cron.pl

View File

@ -10,13 +10,7 @@ use JSON;
$DEBUG = 1; $DEBUG = 1;
$BAK_BASE = '/.zfs/snapshot/'; @BAK_VERSIONS = glob qw( /.zfs/snapshot/autosnap* );
@BAK_VERSIONS = (
'daily.0',
'daily.1',
'daily.2',
'weekly.0'
);
@SCRIPT_PATTERNS = ('.php$', '^.htaccess$', '.js$'); @SCRIPT_PATTERNS = ('.php$', '^.htaccess$', '.js$');
@ -26,9 +20,9 @@ if (@ARGV) {
chomp(my $site = $ARGV[0]); chomp(my $site = $ARGV[0]);
my $real_site = abs_path($site); my $real_site = abs_path($site);
foreach my $bak_vers ( @BAK_VERSIONS ) { foreach my $bak_vers ( @BAK_VERSIONS ) {
my $bak_site = $BAK_BASE . $bak_vers . $real_site; my $bak_site = $bak_vers . $real_site;
if ( -e $BAK_BASE . $bak_vers ) { if ( -e $bak_vers ) {
my @bak_stat = stat($BAK_BASE . $bak_vers); my @bak_stat = stat($bak_vers);
my $bak_date = $bak_stat[9]; my $bak_date = $bak_stat[9];
$RESULTS{'data'}{$bak_date} = (); $RESULTS{'data'}{$bak_date} = ();
$RESULTS{'data'}{$bak_date}{'files'} = (); $RESULTS{'data'}{$bak_date}{'files'} = ();
@ -88,7 +82,7 @@ if (@ARGV) {
close(DIFF); close(DIFF);
} }
else { else {
print STDERR ($BAK_BASE . $bak_vers . " does not exist\n"); print STDERR ($bak_vers . " does not exist\n");
} }
} }
} }