as well as the fact that it's happening 3/4 times makes me think that there's some sort of network connectivity issues. To isolate and confirm this,Error executing run mode 'send_file': Cannot connect to host: Net::FTP +: connect: timeout at /home/domains/xxx/www.xxx.com/aa/system/modules +//FTP.pm line 16. at /home/domains/xxx/www.xxx.com/aa/index.cgi line +20
Note that I used croak instead of die, which will give you more verbose information.use Carp; .... my $ftp = Net::FTP->new("XXX.XX.XX.XXX", Debug => 1, Port => 21, => Ti +meout => 300) or croak "Cannot connect to host: $@";
my $ftp = Net::FTP->new("XXX.XX.XX.XXX", Debug => 1, Port => 21, => Ti +meout => 300); my $num_tries = 0; my $max_tries = 5 #you decide how many times you want to try while ( !$ftp) { if ($num_tries< $max_tries) ) { ++$num_tries; $ftp = Net::FTP->new("XXX.XX.XX.XXX", Debug => 1, Port => 21, + => Timeout => 300); } if ($num_tries >= $max_tries) ) { croak "Cannot connect to host, failed after $num_tries times +: $@"; } }
-- Burvil
In reply to Re: Print debug information from Net::FTP
by bowei_99
in thread Print debug information from Net::FTP
by boboson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |