Added event migration (to deep storage) function.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2586 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
6880f9e2bb
commit
14a05cac4a
|
@ -45,6 +45,7 @@ our %EXPORT_TAGS = (
|
|||
executeShellCommand
|
||||
getEventPath
|
||||
deleteEventFiles
|
||||
makePath
|
||||
) ]
|
||||
);
|
||||
push( @{$EXPORT_TAGS{all}}, @{$EXPORT_TAGS{$_}} ) foreach keys %EXPORT_TAGS;
|
||||
|
@ -149,6 +150,32 @@ sub deleteEventFiles( $;$ )
|
|||
}
|
||||
}
|
||||
|
||||
sub makePath( $$ )
|
||||
{
|
||||
my $root = shift;
|
||||
my $path = shift;
|
||||
|
||||
Debug( "Creating path '$path'\n" );
|
||||
my @parts = split( '/', $path );
|
||||
my $subpath = $root;
|
||||
foreach my $dir ( @parts )
|
||||
{
|
||||
$subpath .= '/'.$dir;
|
||||
if ( !-d $subpath )
|
||||
{
|
||||
if ( -e $subpath )
|
||||
{
|
||||
die( "Can't create '$subpath', already exists as non directory" );
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug( "Creating '$subpath'\n" );
|
||||
mkdir( $subpath ) or die( "Can't mkdir '$subpath': $!" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
# Below is stub documentation for your module. You'd better edit it!
|
||||
|
|
1093
scripts/zmupdate.pl
1093
scripts/zmupdate.pl
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue