aboutsummaryrefslogtreecommitdiff
path: root/lib/App/Beam/Backup.pm
blob: 68d7360dd814f27c9b5c99e9f70fc3735a39552b (plain)
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
package App::Beam::Backup;

use strict;
use Carp;

require App::Beam;
our @ISA = qw(App::Beam);

use Unix::Sysexits;
use App::Beam::History::Entry qw(state_string);

=head1 NAME

beam backup - create new backup

=head1 SYNOPSIS

B<beam> [I<OPTIONS>] B<backup>

=head1 DESCRIPTION

=head1 OPTIONS

=over 4
    
=item B<-h>

Print a short help summary.

=item B<--help>

Display manpage.

=item B<--usage>

Print a short command line usage reminder.    

=back

=cut    

sub run {
    my $self = shift;

    #GetOptionsFromArray(\@_, ...);
    my @items = $self->check_items(@_);
    $self->debug(1, "creating backup " . $self->format_name);
    foreach my $item (@items) {
	$self->debug(1, "backing up $item");
	my $backend = $self->{backend}{$self->get("item.$item.backend")};
	$self->{history}->top->begin_entry($item);
	my $ret = $backend->backup($item);
	$self->{history}->top->finish_entry($item, $ret);
	$self->update_status($ret);
	$self->debug(1, "$item: " . state_string($ret));
    }
}

1;

Return to:

Send suggestions and report system problems to the System administrator.