From 41e0095fbbc2bdde579f70d32b4f9ca100c38643 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 1 Apr 2010 15:13:48 +0000 Subject: [PATCH] Erste Scripte und Module --- bin/backup-per-ftp.pl | 36 +++++++++++++ lib/FrBr/Backup/App.pm | 117 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100755 bin/backup-per-ftp.pl create mode 100644 lib/FrBr/Backup/App.pm diff --git a/bin/backup-per-ftp.pl b/bin/backup-per-ftp.pl new file mode 100755 index 0000000..27348a1 --- /dev/null +++ b/bin/backup-per-ftp.pl @@ -0,0 +1,36 @@ +#!/usr/bin/perl + +# $Id$ +# $URL$ + +use strict; +use warnings; + +use utf8; + +use Encode qw( decode_utf8 encode_utf8 ); + +# Own modules +use FindBin; +use lib "$FindBin::Bin/../lib"; + +use FrBr::Backup::App; + +use version; our $VERSION = qv("0.0.1"); + +my $opts = { +# 'progname' => 'backup-per-ftp', +}; + +my $app = FrBr::Backup::App->new_with_options(%$opts); +$app->evaluate_common_options(); + +#exit($app->exit_code); +exit 0; + + +#-------------------------------------------------------------------------------- + +__END__ + +# vim: noai : ts=4 fenc=utf-8 filetype=perl expandtab : diff --git a/lib/FrBr/Backup/App.pm b/lib/FrBr/Backup/App.pm new file mode 100644 index 0000000..5f340df --- /dev/null +++ b/lib/FrBr/Backup/App.pm @@ -0,0 +1,117 @@ +package FrBr::Backup::App; + +# $Id$ +# $URL$ + +=head1 NAME + +FrBr::Backup::App + +=head1 DESCRIPTION + +Basismodul fuer Backup-Anwendung mittels FTP + +=cut + +#--------------------------------------------------------------------------- + +use Moose; +use MooseX::StrictConstructor; +use Moose::Util::TypeConstraints; + + +use utf8; + +with 'FrBr::Common::MooseX::CommonOpts'; + +#----------------------------------------- + +# Versionitis + +my $Revis = <<'ENDE'; + $Revision$ +ENDE +$Revis =~ s/^.*:\s*(\S+)\s*\$.*/$1/s; + +use version; our $VERSION = qv("0.0.2"); $VERSION .= " r" . $Revis; + +############################################################################################# + +=head1 Eigenschaften + +=cut + +#----------------------------------------- + + +#----------------------------------------- + +# Ändern der Eigenschaften einiger geerbter Attribute + +sub _build_version { + return $VERSION; +} + +########################################################################### + +=head1 METHODS + +Spezielle Methoden und Methodenmodifizierer dieser Anwendung + +=cut + +#--------------------------------- + +around BUILDARGS => sub { + + my $orig = shift; + my $class = shift; + + my %Args = @_; + + #warn "Bin in '" . __PACKAGE__ . "'\n"; + +# $Args{'show_sql'} = 1 if $Args{'verbose'} and $Args{'verbose'} >= 3; + + return $class->$orig(%Args); + +}; + +#--------------------------------- + +sub BUILD { + + my $self = shift; + + #warn "Bin in '" . __PACKAGE__ . "::BUILD'\n"; + +# $self->_init_log(); +# $self->read_config_file(); +# $self->evaluate_config(); + + # Darstellen der Objektstruktur +# if ( $self->verbose >= 2 ) { +# # Aufwecken der faulen Hunde +# my $tmp = $self->pidbase; +# $tmp = $self->pidfile; +# $tmp = $self->progname; +# $tmp = $self->basedir; +# $self->debug( "Anwendungsobjekt vor der Db-Schema-Initialisierung: ", $self ); +# } + +# $self->debug( "Bereit zum Kampf - äh - was auch immer." ); + +} + + +################################################################################### + +__PACKAGE__->meta->make_immutable; + +1; + +#------------------------------------------------------------------------------------------ + +__END__ + +# vim: noai: filetype=perl ts=4 sw=4 : expandtab -- 2.39.5