Operating System - HP-UX
1830850 Members
2453 Online
110017 Solutions
New Discussion

FTP from Windows NT to HP-UX 10.20

 
SOLVED
Go to solution
Preet Dhillon
Advisor

FTP from Windows NT to HP-UX 10.20

I'd like to ftp files from a Windows NT server to my HP-UX server using a script running on the Unix side. I can connect to the Windows server and use ls to see a list of files on the remote machine. I then run 'ls -l > list.txt' to save a list of remote files on the local machine. However this always creates an empty file! Is there a way of saving a list of remote files in a text file on the local machine? My aim eventually is to ftp files to the Unix machine BUT only those which are not already there.
Many thanks in advance.
Nothing succeeds like excess
5 REPLIES 5
Alexander M. Ermes
Honored Contributor
Solution

Re: FTP from Windows NT to HP-UX 10.20

Hi there.
Try this :

ls [remote-directory] [local-file]
Write a listing of remote-directory to local-file. The listing
includes any system-dependent information that the server chooses
to include; for example, most UNIX systems produce output from
the command ls -l (see also nlist). If neither remote-directory
nor local-file is specified, list the remote working directory.
If globbing is enabled, globbing metacharacters are expanded.

This is an extract from the ftp manpages.

Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Thierry Poels_1
Honored Contributor

Re: FTP from Windows NT to HP-UX 10.20

hi,
this should work:
ftp -n aserver << T
user aloginname apassword
ls -l "afilename"
bye
T

but on the other hand, so will this (this will only result in a little bit more garbage from ftp)
ftp -n aserver << T > afilename
user aloginname apassword
ls -l
bye
T

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
CHRIS_ANORUO
Honored Contributor

Re: FTP from Windows NT to HP-UX 10.20

Easiest would be a tar.exe
Here is one.
http://home.mayn.de/ebaumann/download/download-dateien.html
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Rita C Workman
Honored Contributor

Re: FTP from Windows NT to HP-UX 10.20

You've got a couple things you want done here, so here's a couple thoughts,
1. For doing the FTP, you want to write a script that will FTP from UNIX to NT box. Take a look at this thread for some good tips on doing that.
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x1774dfe5920fd5118fef0090279cd0f9,00.html
****
2. Now for that ls command. You can use ls while in FTP, but I've never parsed it to save to a file. FTP is a simple protocol that was just meant to list, get, or put files.
Also remember, even if you telneted to that NT server, once you got there you must use the tools on that server, so your command from whence you came (i.e. UNIX...became moot at that point).
What you would need to do is develop something on your NT box to save this information to a file and then when you FTP from the UNIX server you can now 'get' that file.
It also might help if you saved it as an ascii file, that way you can do the 'dos2ux' and visa versa 'us2dos' to translate.

Hope this helps....but wait for more suggestions, there's always other options,
/rcw
Vincenzo Restuccia
Honored Contributor

Re: FTP from Windows NT to HP-UX 10.20

/usr/bin/ftp -vn <open "IP or hostname"
uer "username""password "
bin
dir file
quit
EOF