[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    RE: Help on  Net::FTP
From:       Ramos Miguel-FMR068c <Miguel_Ramos-FMR068c () email ! mot ! com>
Date:       2000-12-27 16:31:36
[Download RAW message or body]

Thanks Carl!!

Actually it is the same machine, but the script is run with a cron command
and it is on a different path, now it works by setting the whole path to it.

Thanks again.

Miguel Ramos.



-----Original Message-----
From: Carl Jolley [mailto:cjolley@iac.net]
Sent: Thursday, December 21, 2000 11:18 AM
To: Ramos Miguel-FMR068c
Cc: perl-win32-users@listserv1.ActiveState.com
Subject: Re: Help on Net::FTP


On Fri, 15 Dec 2000, Ramos Miguel-FMR068c wrote:

> Hi:
> 
> I am trying to send a text file from a PC to another PC using the FTP
> protocol.
> It works fine when I activate the script manually, but it seems to fail
when
> a cron kind of process activates the script, this is the code:
> 
> my $ftp = Net::FTP->new("ip address", Timeout => 900) or print OUTPUTTT
> "Could not send the file by FTP. \n";
> $ftp->login("user","password") or print OUTPUTTT "Could not log on server,
> please check user and password. \n";
> 
> $ftp->put("reports/report1.csv","/Time_dat/cttdma.csv") or print OUTPUTTT
> "Error trying to put the file on the FTP server\n";
> 
> $ftp->quit;
> 
> I am getting the message of the third line on my log file. It points that
> the $ftp->put instruction failed.
> 
> What can I do to correct this problem?
>

I seen that you are using a relative directory for the local file.
You may need to explicitly set your cd in your script. When you run the
script via the "cron" method is your cd the same as when you run it
manually?  Does the "cron" method run on the same PC as when you do it
manually? 

**** cjolley@iac.net <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic