# HG changeset patch # User Heiko Schlittermann (ZARAFA.ctq.de) hs@schlittermann.de # Date 1302790690 -7200 # Node ID 1f379e39248ae7a70325ad5fd8911abcac9b573f # Parent 840b18b3b93f7ee3db63d67d6c7738e6987ca98e now rely on the dumpdates file, one more nice option (--info) diff -r 840b18b3b93f -r 1f379e39248a ftbackup --- a/ftbackup Tue Apr 12 14:28:58 2011 +0200 +++ b/ftbackup Thu Apr 14 16:18:10 2011 +0200 @@ -1,8 +1,9 @@ #! /usr/bin/perl + +use 5.010; use strict; use warnings; -use 5.10.0; use File::Basename; use Net::FTP; use Perl6::Slurp; @@ -11,6 +12,8 @@ use Time::Local; use Pod::Usage; use POSIX qw(strftime); +use Date::Parse qw(str2time); +use Cwd qw(realpath); use English qw(-no_match_vars); use if $ENV{DEBUG} => qw(Smart::Comments); @@ -31,13 +34,18 @@ my $opt_dry = 0; my $opt_force = 0; my $opt_label = "daily"; +my $opt_info = 0; my $opt_config = ""; my $opt_dumpdates = "/var/lib/dumpdates"; sub get_configs(@); sub get_candidates(); sub verbose(@); -sub iso2epoch($); +sub update_devnames($$$); +sub examine(@); +sub decide($@); +sub real_device($); +sub devno($); our @AT_EXIT; END { $_->() foreach @AT_EXIT } @@ -57,7 +65,8 @@ "L|label=s" => \$opt_label, "d|debug:s" => sub { push @opt_debug, split /,/, $_[1] }, "v|verbose" => \$opt_verbose, - "dry" => \$opt_dry, + "i|info" => \$opt_info, + "dry" => sub { $opt_dry = 1; $opt_verbose = 1 }, "f|force" => \$opt_force, "h|help" => sub { pod2usage(-exit => 0, -verbose => 1) }, "m|man" => sub { pod2usage(-exit => 0, -verbose => 3) }, @@ -69,9 +78,15 @@ my %cf = (%CONFIG, get_configs(@CONFIGS)); $cf{FTP_DIR} =~ s//$HOSTNAME/g; $cf{FTP_DIR} =~ s/