Leser: 19
$ftp -> copy (".bash_history","kopie","/tmp/") or die $ftp -> message;
Quote"/" is the current directory
2009-10-07T16:32:13 LinuxerExistiert denn das Verzeichnis "/tmp" auf dem Zielserver?
Falls nicht, ist es an Dir, es anzulegen.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
perl -MNet::FTP::File -wle 'my $ftp= Net::FTP->new( "ftp.suse.de", Debug=> 1); $ftp->login("anonymous", "-anonymous@" );'
Net::FTP>>> Net::FTP(2.77)
Net::FTP>>> Exporter(5.63)
Net::FTP>>> Net::Cmd(2.29)
Net::FTP>>> IO::Socket::INET(1.31)
Net::FTP>>> IO::Socket(1.31)
Net::FTP>>> IO::Handle(1.28)
Net::FTP=GLOB(0x8305df0)<<< 220 "Welcome to the SuSE ftp server: Please login as user 'ftp'"
Net::FTP=GLOB(0x8305df0)>>> USER anonymous
Net::FTP=GLOB(0x8305df0)<<< 331 Please send your email address as a password.
Net::FTP=GLOB(0x8305df0)>>> PASS ....
Net::FTP=GLOB(0x8305df0)<<< 230 Login successful. Have a lot of fun.
$ftp -> copy (".bash_history","kopie","/tmp/") or die $ftp -> message;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Net::FTP=GLOB(0x1b755e0)>>> PWD
Net::FTP=GLOB(0x1b755e0)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b755e0)>>> HELP SIZE
Net::FTP=GLOB(0x1b755e0)<<< 214 Syntax: SIZE <sp> pathname
Net::FTP=GLOB(0x1b755e0)>>> SIZE .bash_history
Net::FTP=GLOB(0x1b755e0)<<< 550 SIZE not allowed in ASCII mode
Net::FTP=GLOB(0x1b755e0)>>> PWD
Net::FTP=GLOB(0x1b755e0)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b755e0)>>> CWD .bash_history
Net::FTP=GLOB(0x1b755e0)<<< 550 .bash_history: No such file or directory
Net::FTP=GLOB(0x1b755e0)>>> CWD /
Net::FTP=GLOB(0x1b755e0)<<< 250 CWD command successful
Net::FTP=GLOB(0x1b755e0)>>> PWD
Net::FTP=GLOB(0x1b755e0)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b755e0)<<< 550 .bash_history: No such file or directory
1
2
3
4
5
6
7
8
9
/home/ftptest# ls -l . tmp/
.:
total 4
-rw-r--r-- 1 ftptest ftp 520 Apr 22 17:46 README
drwxr-xr-x 2 ftptest ftp 6 Oct 7 19:17 tmp
tmp/:
total 0
/home/ftptest#
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/perl # vi:ts=4 sw=4 et: use strict; use warnings; use Net::FTP::File; my $ftp = Net::FTP->new( 'localhost', Debug => 1 ); $ftp->login( 'ftptest', 'abcdef' ) or die $ftp->message; $ftp->copy( 'README', 'README.txt', '/tmp' ) or die $ftp->message; $ftp->quit; __END__
1
2
3
4
5
6
7
8
9
/home/ftptest# ls -l . tmp/
.:
total 4
-rw-r--r-- 1 ftptest ftp 520 Apr 22 17:46 README
drwxr-xr-x 2 ftptest ftp 23 Oct 7 19:22 tmp
tmp/:
total 4
-rw-r--r-- 1 ftptest ftp 520 Oct 7 19:22 README.txt
Guest werWelches Kommando beherrscht er nicht?
2009-10-08T13:47:53 murphyGuest wercopy ist kein FTP Kommando sondern aus mehreren zusammengesetzt. [...]
Ich denke es gibt auch FTP-Server, die auf ihrer Seite Dateien lokal kopieren können.
$ftp -> binary;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Net::FTP=GLOB(0x1b6ee4c)>>> PWD
Net::FTP=GLOB(0x1b6ee4c)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b6ee4c)>>> SIZE .bash_history
Net::FTP=GLOB(0x1b6ee4c)<<< 213 120
Net::FTP=GLOB(0x1b6ee4c)>>> PWD
Net::FTP=GLOB(0x1b6ee4c)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b6ee4c)>>> CWD .bash_history
Net::FTP=GLOB(0x1b6ee4c)<<< 550 .bash_history: No such file or directory
Net::FTP=GLOB(0x1b6ee4c)>>> CWD /
Net::FTP=GLOB(0x1b6ee4c)<<< 250 CWD command successful
Net::FTP=GLOB(0x1b6ee4c)>>> PWD
Net::FTP=GLOB(0x1b6ee4c)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b6ee4c)>>> PORT 192,168,0,249,5,168
Net::FTP=GLOB(0x1b6ee4c)<<< 200 PORT command successful
Net::FTP=GLOB(0x1b6ee4c)>>> RETR .bash_history
Net::FTP=GLOB(0x1b6ee4c)<<< 150 Opening BINARY mode data connection for .bash_history (120 bytes)
Net::FTP=GLOB(0x1b6ee4c)<<< 226 Transfer complete
Net::FTP=GLOB(0x1b6ee4c)>>> CWD /tmp
Net::FTP=GLOB(0x1b6ee4c)<<< 250 CWD command successful
Net::FTP=GLOB(0x1b6ee4c)>>> PORT 192,168,0,249,5,170
Net::FTP=GLOB(0x1b6ee4c)<<< 200 PORT command successful
Net::FTP=GLOB(0x1b6ee4c)>>> STOR kopie
Net::FTP=GLOB(0x1b6ee4c)<<< 150 Opening BINARY mode data connection for kopie
Net::FTP=GLOB(0x1b6ee4c)<<< 226 Transfer complete
Net::FTP=GLOB(0x1b6ee4c)>>> CWD /
Net::FTP=GLOB(0x1b6ee4c)<<< 250 CWD command successful
Net::FTP=GLOB(0x1b6ee4c)>>> SIZE kopie
Net::FTP=GLOB(0x1b6ee4c)<<< 550 kopie: No such file or directory
Net::FTP=GLOB(0x1b6ee4c)>>> PWD
Net::FTP=GLOB(0x1b6ee4c)<<< 257 "/" is the current directory
Net::FTP=GLOB(0x1b6ee4c)>>> CWD kopie
Net::FTP=GLOB(0x1b6ee4c)<<< 550 kopie: No such file or directory
Net::FTP=GLOB(0x1b6ee4c)>>> CWD /
Net::FTP=GLOB(0x1b6ee4c)<<< 250 CWD command successful
Net::FTP=GLOB(0x1b6ee4c)>>> PWD
Net::FTP=GLOB(0x1b6ee4c)<<< 257 "/" is the current directory