hallo Steffen,
versuchs mal so:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;
use Net::Netrc;
my $server = "X.X.X.X";
my $user = "user";
my $password = "password";
my $destination = "/www/ftp";
my $file = "/home/files/testfile.txt";
my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3); $ftp or die "$server: cannot connect: $@";
$ftp->login ($user,$password) or die "$_: Could not login: " . $ftp->message;
$ftp->cwd($destination);
if (-f "$file") {
$ftp->ascii;
my $remote_name = $ftp->put($file);
$remote_name or die "$server: cannot put $file: " . $ftp->message;
}
$ftp->quit;
[edit: ist repariert]\n\n
<!--EDIT|Oesi50|1087845383-->