From 73d27f50954142cf26c019220f94d5435f227ad0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Nov 2018 10:10:50 -0500 Subject: [PATCH] Add code to see if a db event is stored at the wrong storage area --- scripts/zmaudit.pl.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/zmaudit.pl.in b/scripts/zmaudit.pl.in index 7a5017fbd..c467d26e3 100644 --- a/scripts/zmaudit.pl.in +++ b/scripts/zmaudit.pl.in @@ -531,6 +531,19 @@ MAIN: while( $loop ) { next; } Debug("Event $db_event is not in fs. Should have been at ".$Event->Path()); + # Check for existence in other Storage Areas + foreach my $Storage ( ZoneMinder::Storage->find( ( $$Event{StorageId} ? ( 'Id !='=>$$Event{StorageId} ) : () ) ) ) { + my $path = $Storage->Path().'/'.$Event->RelativePath(); + if ( -e $path ) { + Info("Event $$Event{Id} found at $path instead of $$Event{Path}"); + if ( confirm() ) { + $Event->save({StorageId=>$$Storage{Id}}); + last; + } + } else { + Debug("$$Event{Id} Not found at $path"); + } + } if ( $Event->Archived() ) { Warning("Event $$Event{Id} is Archived. Taking no further action on it."); next;