I do have permission those ftp accounts where created for my usage.
Firewall not blocking i can access the sites with standard ftp client
all the access info was copy/pasted from the origial documents. I also tried to copy paste the user and pass from
my .pwd file and it works great
and I still can connect to one remote and one local ftps using this code
#!/usr/bin/perl -w
use Net::FTP;
use strict;
my $site = shift @ARGV;
my $dir = shift @ARGV;
my $sd = "/SCRIPTS";
my $wd = "/DATA";
my $access_file="$sd/ftp_access_info/$site.pwd";
my $ftp; # name for the ftp class
my $host; # ftp name
my $user; # user name for ftp
my $pass; # password for ftp
my @files; # list of files on the ftp
#get access info from file
open(FTP_ACCESS, "<" , $access_file);
my @ftp_access = <FTP_ACCESS>;
chomp @ftp_access;
close (FTP_ACCESS);
#set access info
$host = $ftp_access[0];
$user = $ftp_access[1];
$pass = $ftp_access[2];
print "|$host|\n|$user|\n|$pass|\n";
#get directory listing
print "Connecting\n";
$ftp=Net::FTP->new("$host",Timeout=>240) or die "connect\n";
print "Loging in\n";
$ftp->login("$user","$pass") or die "login\n";
print "Getting File lists\n";
$ftp->cwd($dir) if $dir;
@files=$ftp->dir or die "dir\n";
print "$_\n" foreach @files;
$ftp->quit;
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.