Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-10-28
10
Medium Priority
?
598 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
Comment
Question by:lifetech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 12440344
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:
Matt_Avery earned 2000 total points
ID: 12443210
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
ID: 12444147
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Author Comment

by:lifetech
ID: 12444339
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
ID: 12444650
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
ID: 12444844
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
ID: 12445105

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
ID: 12446731
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
ID: 12460481
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
ID: 12478142
Thanks Matt! I ended up persuading my boss to run it from Windows to Unix...
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

618 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