$c->{'save'}{'days'} = 7;
}
+ if (defined $c->{'remote'}{'host'}) {
+ die_gracefully("You can't specify both backendhost, and remote host.")
+ if defined $c->{'backedhost'};
+
+ die_gracefully("You've specified the remote host, but not the remote login.")
+ unless defined $c->{'remote'}{'login'};
+
+ $c->{'rmtssh'} = "ssh "
+ . (defined $c->{'remote'}{'sshargs'} ? $c->{'remote'}{'sshargs'} . ' ' : '')
+ . " -l $c->{'remote'}{'login'} $c->{'remote'}{'host'}";
+ }
+
+
$c->{'cp'} ||= "cp -alf";
$c->{'weekdir'} = "$c->{'backuproot'}/$c->{'hostid'}/weekly";
$c->{'daydir'} = "$c->{'backuproot'}/$c->{'hostid'}/daily";
$c->{'lday'} = strftime("image-%Y-%m-%d-%H", localtime() - 3600 * 24);
$c->{'1week'} = strftime("image-%Y-%m-%d-%H", localtime() - 3600 * 24 * 7);
+
return $c;
};
sub die_gracefully {
my $message = shift;
+ push @errors, $message
+ if defined $message;
+
if ($#errors > 0 || $#warnings > 0 || defined $message) {
handle_output($message);
}
- print "$message\n"
- if defined $message;
-
exit 0;
}