Hi,
I am trying to write a backup tool with Perl and Net::FTP module.
I have one central Windows XP Professional server with large disk space and have several Windows NT machines.
I would like to ftp each NT machine and get 4 or 5 files to the XP server.
my sample code is below...
my problem is timeout...it is starting to get files
but so many times I am getting below error message;
"Timeout at /usr/lib/perl5/5.8.5/Net/FTP.pm line 503"
and after that ftp session disconnect.
I increased the Timeout value but nothing is changed.
Do you have any idea ? What is wrong ?
Could you please help me to solve this issue...
Thank you very much for your valuable help...
========================================================
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::FTP;
use Net::Telnet ();
sub ftpnd
{
my $host = $_[0]; my $Fusername = "XXXXX";
my $Fpasswd = "yyyyyy";
my $ftpobj = Net::FTP -> new ($host, Debug => 0, Timeout => 240) or di
+e "Cannot connect $@";
$ftpobj -> login($Fusername,$Fpasswd) or die "Cannot Login ",$ftpobj->
+message; ;
$ftpobj -> cwd ("ftpvol/relfsw2");
$ftpobj -> binary;
my @Flist = $ftpobj->ls("*");
foreach my $file (@Flist)
{
$ftpobj->get($file) or die "can't get file: $!";
}
$ftpobj -> quit;
return;
}
ftpnd("10.202.14.130");
}
=========================================================
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.