More general defaults

This commit is contained in:
hjp 2006-11-20 11:26:30 +00:00
parent d5d55b5536
commit b53938127a
1 changed files with 21 additions and 3 deletions

View File

@ -21,10 +21,9 @@ sub new {
my $self = {};
bless $self, $class;
$self->{basedir} = '/home/hjp/backup';
$self->{basedir} = '/backup';
$self->{targets} = [
{ host => 'localhost', dir => '/home/hjp/test/', },
# { host => 'users.wsr.ac.at', dir => '/shares/user', },
{ host => 'localhost', dir => '/var/tmp', },
];
return $self;
@ -181,5 +180,24 @@ sub mkdir_p {
return undef;
}
}
sub basedir {
my ($self, $dir) = @_;
$self->{basedir} = $dir if defined($dir);
return $self->{basedir};
}
sub targets {
my ($self, $targets) = @_;
$self->{targets} = $targets if defined($targets);
return $self->{targets};
}
sub add_target {
my ($self, $target) = @_;
push @{ $self->{targets} }, $target;
return $self->{targets};
}
# vim: tw=0 expandtab
1;