Operating System - HP-UX
1821252 Members
2829 Online
109632 Solutions
New Discussion юеВ

Transfer files from Unix Server to PC

 
yanfeng Zhou
Occasional Advisor

Transfer files from Unix Server to PC

Hi, All:

I have a quesstion need your help. I'm trying to find a way to transfer a file from unix server to pc in unix command line. I've checked my books shipped with machine. But failed to find a solution. My unix host is HP 9000 K420 with HP unix 10.20. My pc is windows serials.

Thanks & Regards,
16 REPLIES 16
Bill Hassell
Honored Contributor

Re: Transfer files from Unix Server to PC

Windows doesn't normally have Unix daemons for ftp or rcp so you'll have to read up on your version of Windows to enable incoming ftp or rcp. ftp requires several commands so a one-line command won't be possible but a script is easy (see attachment here). rcp will have problems with user authentication between the systems but should eventually work.


Bill Hassell, sysadmin
Sukant Naik
Trusted Contributor

Re: Transfer files from Unix Server to PC

Hi

I have installed CIFS, which is SAMBA for HP-UX on my server.

So I create smb shares and then browse from the PC.

-Sukant
Who dares he wins
yanfeng Zhou
Occasional Advisor

Re: Transfer files from Unix Server to PC

Hi,

Thanks, Bill and Sukant. Both of your solution can approach my request. But I'm looking for a more simple way. I found there's a tool named "kermit" on unix, and I've tried this tool, but I fail to transfer file to PC. The message is as following:

"KERMIT READY TO SEND...
8 Sz/ @-#Y3~^! z0___D"U1A"

Can you help me?


Thanks & Regards,
Stefan Saliba
Trusted Contributor

Re: Transfer files from Unix Server to PC

I think bill's and Suktant are indeed the best solutions.

Well if you want to use kermit then I think that will limit you to the serial line speed. If you have large files to transfer it will take ages.

Let me re-phrase what they suggested in simpler terms.


Go to http://www.download.com and get a freeware version of any FTP server for windows. This is a program which will accept ftp requests on the windows side. There are many around, some are freeware.

Then simply use ftp on the UNIX server to transfer files. You will get faster speed then serial for sure and much more flexible and hassle free.

Suktant solution works but may get a bit hairy to configure, so given you want a simple solution I go for ftp.


Good luck

Stefan


Scott Van Kalken
Esteemed Contributor

Re: Transfer files from Unix Server to PC

#!/bin/sh
set -x
ftp -i -n << !EOF
open 10.196.8.241
user anonymous scott@unix.com
lcd /tmp
cd /foo
bin
mput *
bye
!EOF


That should do the job.

This is essentially what I use to transfer omniback reports from my unix box the an IIS web server.

Though it took me MONTHS to get the windows guys to understand that i wanted FTP access and not file copy via a mapped drive.

yanfeng Zhou
Occasional Advisor

Re: Transfer files from Unix Server to PC

Hi Stefan:

Thanks for your reply first. Maybe I did not explain the background of my problem. I have a ERP system named MFG/PRO running on HP Unix. The ERP system can generate some report by the end user. And the user have to use a ftp client to download the report to their PC for further use.(This is the way what we using now) But, many user are not familiar with ftp client, due to the employees in/out is frequent here. So I'm seeking a way to let the use just click a button or make a choice, the system will transfer the file to the users' PC automaticly. If I use a ftp server on local, I have to teach 2 things to my users, first, how to use ftp under unix(it's impossible, we do not allow the user to go to the unix command line for security), second, setup ftp server on PC. That's far from what I want to get.

And about the traffic of the file transfer, I think it is not a problem currently, for the ERP report won't be large than 1M normally.

Please advise.

Thanks & Regards,
Scott Van Kalken
Esteemed Contributor

Re: Transfer files from Unix Server to PC

You may want to consider using either samba or NFS.

We run Novell here and have set up an NFS gateway where unix filesystems appear in explorer. We can map them as drives etc...

Another solution would be to use samba, which can be obtained from http://www.software.hp.com

Another solution is to email the report to your people

you can use:

uuencode report report.txt | mailx -m foo@foo.org

This will mail the report as an attachment.

We use this also for certain jobs because people are more comfortable receiving an attachment.

Scott.
yanfeng Zhou
Occasional Advisor

Re: Transfer files from Unix Server to PC

Hi, Scott:

Thanks, I'll try your solution.

Thanks again.
Keely Jackson
Trusted Contributor

Re: Transfer files from Unix Server to PC

Hi

Does it have to be via unix command line? If not, do your users use Reflection or something similar to access MFG/Pro. We wrote a very simple reflection macro or script to do the file transfer for you using the WRQ/ftp transfer part of reflections. Then the users just have to click on a button on the screen and enter the file name to be copied.

The other option we used to use was to set up a print location within mfg/pro of emailme which called a script to e-mail the reports directly to their pc.

Cheers
Keely
Live long and prosper
yanfeng Zhou
Occasional Advisor

Re: Transfer files from Unix Server to PC

Hi, Keely:

Yes, we use "WRQ Reflection" to connect to HP Unix. And I'm realy interested in your script solution. Please kindly show me your sample. My email address, yfzhou72@163.com.

Thanks & Regards,
Keely Jackson
Trusted Contributor

Re: Transfer files from Unix Server to PC

Hi

Script is attached.

You will need to ensure that the wrq/transfer program unxlink2 is installed on your server and that the script menu is in the menu bar. Both these are explained (I use that word advisedly) in the help. Once you have the script as you want it, just add a button to the toolbar.

If you need any help with any of the above, just let me know.

Cheers
Keely
Live long and prosper
John Dvorchak
Honored Contributor

Re: Transfer files from Unix Server to PC

What we do here and in the last place I worked, was to use CIFS 9000(Samba). It is free from HP and it makes your HP server look like a Window server on the LAN. Then your users only need to connect to it, or map a drive to it, like it is a Window server. Then they are back in familiar territory. I would think that this is much easier on you and the users than playing games with email etc. Also included with CIFS is SWAT, which is a web interface to completly setup and maintain CIFS.
Good luck.
If it has wheels or a skirt, you can't afford it.
A. Clay Stephenson
Acclaimed Contributor

Re: Transfer files from Unix Server to PC

Let me give you another approach that requires no Refection and incorporates error checking as well. The error check and automatic retry is a far from easy task using other methods.


I would turn the problem around and create a shortcut on the PC to launch 'perl ftp.pl file1 file2 ...'. That will then login to the UNIX host, set for ASCII transfers, cd to /tmp, and then download file1, file2 ... .

You can get a free version of Perl for your
Windows platform from www.activeperl.com. You would then need to install the Net::FTP module which is available from www.cpan.org. If you ever start using the Net::FTP Perl module, I can just about guarantee that you will stop using any other method. The beauty of this approach is that it will work on UNIX, Windows, VMS, ... .

Here is the attached Perl script, ftp.pl.

If it ain't broke, I can fix that.
Dave La Mar
Honored Contributor

Re: Transfer files from Unix Server to PC

Yanfeng -
We have similar cases.
User has windows machine and wants a file from some other machine, (NT, Unix, etc.).
To perform this, we set up an icon on their desk top which points to a bat file.
The bat file calls another file with the ftp parms in it, gets (or puts) a file and exits.

Here they are -
Bat file:

ftp -n -s:command.cmd

The above is the only line in the bat file; "command.cmd" is the file with the ftp commands.

Contents of command.cmd -

open 172.XX.X.X
user name password
ascii
get file_name.txt
quit
exit

In the above "name" is the user login name to unix and "password" is the unix password. The open statement may be an ip address or dns name.

This works fine for us, hope for you as well.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
yanfeng Zhou
Occasional Advisor

Re: Transfer files from Unix Server to PC

Hi, All:

Thank you so much for your help! I'll try your solutions and I think I can find a best for me from them at the end.

So, thanks again to you all!

Best Regards,
Robert Sipe
Occasional Advisor

Re: Transfer files from Unix Server to PC

In Dos you should be able to ftp provided your pc is on the network. If you are using your pc for login services and have an email account go to your unix server and elm the file over.
None