Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ftp from UNIX to Windows directory

Status
Not open for further replies.

Kchinnaswamy

IS-IT--Management
Jan 31, 2001
27
US
Does anyone have any idea whether I can do an ftp from my unix server to my local drive? If so, could you please let me know how to do it. I need this automated. I appreciate any help.

thanks

Kumar
 
No you can't push the files unless you have a ftp daemon running on your windows box. You can however schedule an ftp session to pull the files from the unix system.
Alternatively you could have samba (or other smb protocol) installed on the unix system and then copy to a writeable share on your windows system.
hth
stan
 
At least with Win2k and Win98 workstations, it´s possible, and I have it working fine.

Suppose that you wanna get into an Win2K workstation the file "/tmp/backup_log" , from UNIX machine with IP address 101.102.103.104 . Of course, you´ll need an UNIX user with read permission in /tmp , for example , user "log_viewer" with password "lemmeC". Try the following steps :

1)create a text file in the workstation containing the commands you would run to do the ftp , including the login. With our example data, these commands would be:

user
log_viewer
lemmeC
bin
cd /tmp
get backup_log
quit

(you can do it with EDIT , Notepad or Wordpad, for example )

2) Supposing you named this text file as "ftp_script" , test it by executing at MSDOS prompt :

C:\WINNT>
ftp -n -s:ftp_script 101.102.103.104

3) You´ll get the file in C:\WINNT . All the ftp steps were echoed, but you can suppress them by adding the -v option . So , you can create a regular batch file in your workstation, including this command and any pre or post processing you need , for example :

ftp -n -v -s:ftp_script 101.102.103.104
d:
cd /backup_logs/
move c:backup_log log%d

4) The best part of it, now you can schedule this batch in Task Scheduler.

You can improve it somewhat, anonymous login for example. Try "ftp -?" or "ftp -help" on the MSDOS prompt. It also helps to understand the hint.

The drawback : the UNIX user password will be visible in ftp_script. That´s why I suggested to create an user with as few rights as possible. "root" is not an option !

Try it and if you have trouble, thread it back in our Forum.
Best Regards.



 
Guerra

You missed the key point of his question...or maybe i did?

"whether I can do an ftp from my unix server to my local drive"

I was assuming he wanted the unix system to push the files down to his windows system. Yes any windows system with tcp/ip loaded can run ftp and pull the files down.

stan
 
When you install samba (Free) on your
unix box you can copy files from windows
to unix as if the unix box was an NT-server.
When you use Linux it go's both ways.
Gregor.Weertman@mailcity.com
 
Samba (application/daemon) which runs on almost any *nix (operating system) provides both the server side of the smb protocols and the client side. You can use the smbclient much like you can use ftp.

example

smbclient //winbox/sharename -N -c put filename

This would copy the file "filename" to the share called "sharename" on the machine called winbox. It assumes that the share is writeable and has no password on it. Other switches will allow for usernames and passwords. This allows you *nix machine to interact with any windows machine in a peer to peer style.

gregorweertman, I don't understand your reference to linux vs samba.

stan
 

You can get MS Personal Web Server which runs on at least 98 and up as an option
 

smbmount does only work on linux so far
as I know.
smbmount mount's a windows share to a linux
directory.

syntax: mount -t smbfs //winpc/winshare /lnxsdir -o username=moi,password=forgot

this way you can drag and drop with your gui
like always.

Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top