Solved

FTP from unix (HP-UX) to Windows 2000 server

Posted on 2004-10-28
573 Views
Last Modified: 2013-12-23
I need to know how to initiate an FTP transfer from a Unix Server (users home directory) to a Windows server on the same LAN. Ive been able set up a batch file initiated in windows that will pull the file from the Unix server, however my boss wants this initiated in Unix - not from Windows.
I know DOS batch commands and FTP commands well, however I am stuck at to how to direct the file transfer to a specific directory on windows. I have been experimenting with the put command - is this a good place to start?
0
Question by:lifetech
    10 Comments
     
    LVL 38

    Expert Comment

    by:yuzh
    You need to have FTP server running in your W2k box, and your DOS batch command
    will not run under Unix (HP-UX).

    if you want to backup data from HP-UX to W2k server, you can use rsync, see:
    http:Q_20800890.html

    If you still want to use ftp script (FTP is insecure, plain text password!), consider
    setup secure shell in your HP-UX box, and install secure shell in your W2k box, and
    use secure FTP to transfer the files.

    IF you don't care about security, have a look at the following FTP script:
    http:Q_20702441.html
    http:Q_20800090.html
    0
     
    LVL 2

    Accepted Solution

    by:
    Actually, I think yuzh has already answered the question but here are a few thoughts:

    Problem #1 - need to make sure that an FTP server is installed on the Windows machine in the first place

    Problem #2 - need to configure the Windows FTP server so that FTP clients can actually write to the relevant directory. (Most Unix FTP servers will let you read/write files to any directory you want, as long as your ID has the necessary permissions. By contrast, Windows FTP servers tend only to expose certain directories)

    Devious Solution #1 - Persuade your boss that it really is a better idea to initiate the transfer from Windows (no need to install an FTP server on your Windows machine)

    Devious Solution #2 - Share the windows directory and access it from the unix machine using the "smbclient" program instead of FTP.
    0
     
    LVL 3

    Author Comment

    by:lifetech
    The main problem is touched on by Matt (problem #2). I will try the suggestions. Yuzh - thank you for the sequrity warning. I dont believe security is an issue, but it is best to be informed.
    0
     
    LVL 3

    Author Comment

    by:lifetech
    The reason (which I don't totally agree with) he wants this to happen from the Unix box is that a report will ge generated by a Unix user. Each time this report is generated, he wants the script to then run and send the file. He wants to avoid the second step of manually initiating the transfer from the W2K box.
    0
     
    LVL 2

    Expert Comment

    by:Matt_Avery
    Thinking outside the box again, here are a few more non-FTP solutions:

    1. Don't place the file in a directory on the Windows box, send it via e-mail (very easy using "mail" or "mailx"). You might even be able to convince the customer that this is a more sophisticated solution.

    2. Install Samba and share the directory on the Unix server, so that it appears as a network drive under Windows (however installing and configuring Samba is fairly tedious IMO).

    3. Install a web server and make the file available to the windows user via HTTP. (Most Unix / Linux distributions seem to come bundled with a pre-configured version of Apache these days, so this would be fairly easy). Might also be able to sell this to the customer as a more sophisticated solution.
    0
     
    LVL 3

    Author Comment

    by:lifetech
    Matt - I like the way you think. Don't know if they will go for any of these - but I love the ideas. What is the syntax for the mail or mailx commands? One more question - Once an ftp session is initiated at the W2K box (from a Unix command prompt) how do I see the directories available?
    0
     
    LVL 2

    Expert Comment

    by:Matt_Avery

    Re: "mail" and "mailx", the basic syntax is:

       mailx foo@bar.com < filename.txt

    "mailx" accepts a command line option of the form ' -s "Subject Line" ' , whilst "mail" allows you to preface your note with as many RFC822 header lines as you like (difficult to learn, but potentially very powerful). There are many questions and answers on this website involving "mail" and "mailx", if you have time to browse around.

    (where "filename.txt" is the body of the e-mail you want to send)

    Re: Command line FTP - FTP clients tend to accept the same commands as the local operating system. So the FTP client on a Unix box will probably accept the commands "ls -l" and "pwd", whilst FTP on a Windows machine will accept "dir". (The FTP client always has to translate your commands into FTP protocol commands anyway, so it makes sense for it to accept commands that might be familiar to a local user)


    0
     
    LVL 3

    Author Comment

    by:lifetech
    I have another "outside the box" idea. I can Telnet to the windows box, login, then call the Batch script on the windows system to send the file from Unix to windows. I got this to work manually,  however - I don't know if there is a wayt to automate the login process. Don't know how much of a security hole this will open. Could a script be used for this?
    0
     
    LVL 38

    Expert Comment

    by:yuzh
    If you want to send the report as a proper email attachment, you can use "mutt",
    the systax:

     mutt email@ddress -a filename.to.attache -s "Subject of email" < file.containing.message.body


    You can download mutt from:
    http://hpux.cs.utah.edu/hppd/hpux/Networking/Mail/mutt-1.4.2.1/

    Please remember to install all the dependencies.
    0
     
    LVL 3

    Author Comment

    by:lifetech
    Thanks Matt! I ended up persuading my boss to run it from Windows to Unix...
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Lets look at the default installation and configuration of FreeProxy 4.10 REQUIREMENTS 1. FreeProxy 4.10 Application - Can be downloaded here (http://www.handcraftedsoftware.org/index.php?page=download) 2. Ensure that you disable the windows fi…
    Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    933 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now