Leser: 1
7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!perl
use strict;
use Net::FTP::Common;
my $cfg = { Host => 'xxx.xxx.xxx.xxx',
User => 'xxxx',
Pass => 'xxxx',
RemoteDir => '/dir',
LocalDir => 'C:\Dir',
LocalFile => 'file.txt',
};
my $ftp = Net::FTP::Common->new($cfg, Debug => 1);
$ftp->get(File => 'file.txt');
$ftp->quit;
QuoteNet::FTP::Common::VERSION = 5.2g at C:/tools/perl/site/lib/Net/FTP/Common.pm line 50.
Net::FTP>>> Net::FTP(2.72)
Net::FTP>>> Exporter(5.57)
Net::FTP>>> Net::Cmd(2.24)
Net::FTP>>> IO::Socket::INET(1.27)
Net::FTP>>> IO::Socket(1.28)
Net::FTP>>> IO::Handle(1.23)
Net::FTP=GLOB(0x1cbf06c)<<< 220 owdbfr03.owh.de FTP server ready.
Net::FTP=GLOB(0x1cbf06c)>>> user xxxx
Net::FTP=GLOB(0x1cbf06c)<<< 331 Password required for dwhp.
Net::FTP=GLOB(0x1cbf06c)>>> PASS ....
Net::FTP=GLOB(0x1cbf06c)<<< 230 User xxxx logged in.
Net::FTP=GLOB(0x1cbf06c)>>> CWD /dir
Net::FTP=GLOB(0x1cbf06c)<<< 250 CWD command successful.
Net::FTP=GLOB(0x1cbf06c)>>> TYPE I
Net::FTP=GLOB(0x1cbf06c)<<< 200 Type set to I.
Net::FTP=GLOB(0x1cbf06c)>>> PORT 172,22,20,1,7,188
Net::FTP=GLOB(0x1cbf06c)<<< 200 PORT command successful.
Net::FTP=GLOB(0x1cbf06c)>>> RETR
Net::FTP=GLOB(0x1cbf06c)<<< 500 'RETR ': command not understood.
download of to file.txt failed at C:/tools/perl/site/lib/Net/FTP/Common.pm line 372.
here are the settings in your Net::FTP::Common object: %s$VAR1 = bless( {
'Debug' => 1,
'Common' => {
'FTPSession' => bless( \*Symbol::GEN0, 'Net::FTP' ),
'RemoteDir' => '/dir',
'User' => 'xxxx',
'Pass' => 'xxxx',
'Type' => 'I',
'LocalFile' => 'file.txt',
'File' => 'file.txt',
'LocalDir' => 'C:\dir',
'Host' => 'xxx.xxx.xxx.xxx'
},
'Passive' => 1,
'Timeout' => 240
}, 'Net::FTP::Common' );
Net::FTP=GLOB(0x1cbf06c)>>> PWD
Net::FTP=GLOB(0x1cbf06c)<<< 257 "/dir" is current directory.
Net::FTP=GLOB(0x1cbf06c)>>> QUIT
Net::FTP=GLOB(0x1cbf06c)<<< 221-You have transferred 0 bytes in 0 files.
Net::FTP=GLOB(0x1cbf06c)<<< 221-Total traffic for this session was 409 bytes in 0 transfers.
Net::FTP=GLOB(0x1cbf06c)<<< 221-Thank you for using the FTP service on xxxx.
Net::FTP=GLOB(0x1cbf06c)<<< 221 Goodbye.
Process completed, Exit Code 0.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Net::FTP; # Für FTP
my $server="servername.domain";
my $username="user";
my $password="pass";
my $pfad="/irgendwas";
my $dateilokal="C:\\daisses.txt";
my $datei="xyz.xml";
$ftp=Net::FTP->new($server, Debug=>0) || die "Keine Verbindung mit $server.\n";
$ftp->login($username, $password) || die "Fehler beim einloggen.\n";
$ftp->cwd($pfad);
$ftp->ascii();
$ftp->get($datei, $dateilokal) || die "Fehler beim herunterladen von $datei auf $server.\n";
$ftp->quit() || die "Fehler beim ausloggen von $server.\n\n";
7 Einträge, 1 Seite |