
stamina_josh
New User
Jul 8, 2008, 9:18 AM
Post #1 of 3
(942 views)
|
|
Net::Ftp in a scheduled task
|
Can't Post
|
|
Hi, I am trying to use Net::Ftp in a windows scheduled task but it just won't work. I scaled down my script to just try and do a directory listing to keep it as simple as poss: ___________________________________ $dest_server = "blah" ; $remote_user = "blah"; $remote_pass = "blah" ; my @remote_files ; print "Logging into $dest_server\n" ; my $ftp_conn = Net::FTP->new($dest_server) or die "Can't open $dest_server $@\n" ; $ftp_conn->login($remote_user, $remote_pass) or die "Can't login to $dest_server $@\n" ; print "Successfully logged in.\n" ; print "Setting to binary mode.\n" ; $ftp_conn->binary() ; my @remote_files = $ftp_conn->ls ; print "remote files: \n" ; map {print $_ ."\n" } @remote_files ; if (! @remote_files) { print "\tNo files found.\n" } ___________________________________ This works absolutely fine from the command line (using cygwin). Can anyone please help?
|