in reply to Re: ftping a file from a remote server to another remote server
in thread ftping a file from a remote server to another remote server
Thanks for your reply,
here is my code.
I need a perl script or module which could ftp a file from A server to B server and from B to C server and the script should be running on A server. and there is no connection between A to C and for each server(A,B,C) user and password authentication is required. please help on it. i had writen a script on below plese look into it and help me on it. on server A some.hostA.com the below script have been writen. and trying to execute on the A server.
#!/usr/bin/perl use Net::FTP; $ftp = Net::FTP->new("some.hostB.com", D +ebug => 0) or die "Cannot connect to some.host.name: $@"; $ftp->login +("xxx",'xxx') or die "Cannot login ", $ftp->message; #$ftp->cwd("/pub +") # or die "Cannot change working directory ", $ftp->message; $ftp-> +put("cron/eid_inv_ftp.pl"); $newftp = Net::FTP->new("some.hostC.com", + Debug => 0) or die "Cannot connect to some.host1.name: $@"; $newftp- +>login("xxxx",'xxx') or die "Cannot login ", $newftp->message; print +$newftp->pwd(); $newftp->put($ftp->get("/export/home/xx/debugtrans.pl +")) or die "put failed ", $newftp->message; $newftp->quit; $ftp->quit +;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: ftping a file from a remote server to another remote server
by Marshall (Canon) on Jul 20, 2011 at 05:30 UTC | |
by shivamem (Initiate) on Jul 20, 2011 at 08:41 UTC | |
by ww (Archbishop) on Jul 20, 2011 at 10:19 UTC | |
by Marshall (Canon) on Jul 20, 2011 at 18:22 UTC |