/usr/share/perl5/NetApp/Snapshot/Schedule.pm is in libnetapp-perl 1.1.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | #
# $Id: Snapmirror.pm 203 2008-06-20 18:00:43Z pmoore $
#
package NetApp::Snapshot::Schedule;
use version; $VERSION = version->new(qw$Revision: 203 $);
use strict;
use warnings;
use Carp;
use Class::Std;
use Params::Validate qw( :all );
{
my %parent_of :ATTR( get => 'parent' );
my %weekly_of :ATTR( get => 'weekly' );
my %daily_of :ATTR( get => 'daily' );
my %hourly_of :ATTR( get => 'hourly' );
my %hourlist_of :ATTR;
sub BUILD {
my ($self,$ident,$args_ref) = @_;
my @args = %$args_ref;
my (%args) = validate( @args, {
parent => { type => OBJECT },
weekly => { type => SCALAR },
daily => { type => SCALAR },
hourly => { type => SCALAR },
hourlist => { type => ARRAYREF,
default => [],
optional => 1 },
});
$parent_of{$ident} = $args{parent};
$weekly_of{$ident} = $args{weekly};
$daily_of{$ident} = $args{daily};
$hourly_of{$ident} = $args{hourly};
$hourlist_of{$ident} = $args{hourlist};
}
sub get_hourlist {
return @{ $hourlist_of{ident shift} };
}
}
sub _parse_snap_sched {
my $class = shift;
my $line = shift;
my ($weekly,$daily,$hourly,$hourlist) = (split( /[@\s]+/, $line ))[2..5];
if ( $hourlist ) {
$hourlist = [ split( /,/, $hourlist ) ];
} else {
$hourlist = [];
}
if ( $weekly !~ /^\d+$/ || $daily !~ /^\d+$/ || $hourly !~ /^\d+$/ ) {
croak("Unable to parse snap sched: $line\n");
}
return {
weekly => $weekly,
daily => $daily,
hourly => $hourly,
hourlist => $hourlist,
};
}
1;
|