From f58f96c1c86ab910f3dc456579ab8abf093b3742 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 13 May 2010 07:59:28 +0000 Subject: [PATCH] Sinnvollen Anfang gefunden --- bin/backup-per-ftp.pl | 10 ++++++---- lib/FrBr/Backup/App.pm | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/bin/backup-per-ftp.pl b/bin/backup-per-ftp.pl index 68e1b66..a89f87a 100755 --- a/bin/backup-per-ftp.pl +++ b/bin/backup-per-ftp.pl @@ -17,17 +17,19 @@ use lib "$FindBin::Bin/../lib"; #use FrBr::Backup::App; require FrBr::Backup::App; -use version; our $VERSION = qv("0.0.1"); +use version; our $VERSION = qv("0.0.2"); my $opts = { -# 'progname' => 'backup-per-ftp', + 'progname' => 'backup-per-ftp', 'ftp_auto_login' => 0, }; my $app = FrBr::Backup::App->new_with_options(%$opts); -#exit($app->exit_code); -exit 0; +$app->run(); + +exit($app->exit_code); +#exit 0; #-------------------------------------------------------------------------------- diff --git a/lib/FrBr/Backup/App.pm b/lib/FrBr/Backup/App.pm index ef769ef..acec40d 100644 --- a/lib/FrBr/Backup/App.pm +++ b/lib/FrBr/Backup/App.pm @@ -131,6 +131,33 @@ sub BUILD { } +#--------------------------------- + +=head2 run( ) + +Die eigentliche Startroutine der Anwendung. + +=cut + +sub run { + + my $self = shift; + + $self->info( "Verbinde mich FTP-Server ..." ); + + unless ( $self->init_ftp() ) { + $self->exit_code( 5 ); + return; + } + + unless ( $self->login_ftp() ) { + $self->exit_code( 6 ); + return; + } + + $self->info( "Beginne Backup." ); + +} ################################################################################### -- 2.39.5