October 10th, 2000, 02:42 PM
How do I FTP all of the files in a directory from one server to a directory on another server?
October 11th, 2000, 03:46 AM
Do you want to do it with Perl or with a FTP program? And why do you post this question twice?
October 11th, 2000, 11:34 AM
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by MeijdenB:
Do you want to do it with Perl or with a FTP program?
I want to do it with a perl program.
And why do you post this question twice? Just an itchy clicker finger, I guess. Sorry.[/quote]
October 11th, 2000, 07:49 PM
Go to CPAN and download the Net::FTP module. Then read its docs, and then you will be set. If you wnat to get really "dangerous" then go and read the RFC for FTP, and learn something about sockets and read the documentation that comes with IO::Socekt module (bundled with Perl 5.004 and higher).
My reccomendation is to download the module...
October 17th, 2000, 04:42 AM
Although you could write your own program, it would be much easier to use the "prox" command in ftp on unix/linux. You can also find some windows programs to do this but I can't remember any..
To use the prox command here is an example>
ftp> open <site 1> <port>
^ connect to site 1
ftp> prox open <site 2> <port>
^ connect to site 2
ftp> cd public_html
^ change to desired dir on site 1
ftp> prox cd public_html
^ ditton on site 2
^ diable prompting (depending on what your doing)
ftp> prox mget *.html
^ put all *.html files from site 1 to site 2
for more info just read the ftp man
or if it needs to be dynamic or something you could try using a Perl program to write a .netrc file or something similar that contains these commands
and then just call ftp from within perl.
[This message has been edited by r-c (edited October 17, 2000).]