ortsac has asked for the wisdom of the Perl Monks concerning the following question:

Is there any script that goes to a DOS box from a Unix box, FTPs a directory and its contents back into a Unix box?

Replies are listed 'Best First'.
Re: FTP from DOS to Unix and back
by BazB (Priest) on Sep 19, 2002 at 21:43 UTC

    It shouldn't really matter what host type the client or the server is.

    There are probably scripts out there that will do this or something similar (or you could use a command line tool like ncftp or plain old ftp).
    If you've got five minutes, read the perldoc for Net::FTP, and you should be able to knock together a script yourself.

    If that doesn't appeal, have a rummage through the Code Catacombs, particularly FTP stuff.

    BazB

Re: FTP from DOS to Unix and back
by spartacus9 (Beadle) on Sep 20, 2002 at 03:22 UTC
    This solution doesn't have anything to do with Perl, but here's how I have accomplished the same thing:
    ftp -n your.destination.host <<End-Of-Session user username password ascii lcd /local/directory cd /remote/directory prompt mget * bye End-Of-Session
    Brief explanation: the "-n" option with FTP allows you to automate the process and pass the username/password without having to type them in response to a prompt -- this allows me to use it in a cron job. The "prompt" statement toggles prompting mode, in this case turning it off. "mget *" gets everything in the directory on the remote server. "bye" closes the connection. I hope this helps.