# HG changeset patch # User Heiko Schlittermann (CTQ.kx.schlittermann.de) # Date 1304416206 -7200 # Node ID f6a277e9bda83fec1d0191a939a2a9690683286c # Parent 73e32571b22fa1f77c0186b8671129c70c010e4f start the FTP connectioni later, to avoid silly timeouts diff -r 73e32571b22f -r f6a277e9bda8 bin/ftbackup --- a/bin/ftbackup Mon May 02 14:40:54 2011 +0200 +++ b/bin/ftbackup Tue May 03 11:50:06 2011 +0200 @@ -118,19 +118,6 @@ my $ftp; - if (not "output" ~~ \@opt_debug) { - $ftp = new FTP( - $cf{FTP_HOST}, - Passive => $cf{FTP_PASSIVE}, - Debug => "ftp" ~~ \@opt_debug, - ) or die $@; - $ftp->login or die $ftp->message; - $ftp->home($ftp->try(pwd => ())); - $ftp->try(binary => ()); - $ftp->try(mkpath => $cf{FTP_DIR}); - $ftp->try(cwd => $cf{FTP_DIR}); - } - # get_history the situation - we rely on $opt_dumpdates @devs = get_history(@devs); @devs = calculate_level($cf{FULL_CYCLE}, @devs); @@ -173,6 +160,20 @@ exit; } + if (not "output" ~~ \@opt_debug) { + $ftp = new FTP( + $cf{FTP_HOST}, + Passive => $cf{FTP_PASSIVE}, + Debug => "ftp" ~~ \@opt_debug, + ) or die $@; + $ftp->login or die $ftp->message; + $ftp->home($ftp->try(pwd => ())); + $ftp->try(binary => ()); + $ftp->try(mkpath => $cf{FTP_DIR}); + $ftp->try(cwd => $cf{FTP_DIR}); + } + + # and now we can start doing something with our filesystems DEVICE: foreach my $dev (@devs) { my $dir = $dev->{mountpoint};