Shell Script to transfer files from unix to windows


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script to transfer files from unix to windows
# 1  
Old 10-24-2011
Shell Script to transfer files from unix to windows

I have to transfer a file from unix to windows through Shell Script. I am using the below script, but it is not working. Please help. Please note --- I have to transfer the file from unix to windows. Not from windows to unix. I mean I don't have to use batch script.Only through unix shell script.
Code:
filenames= $(
find . -name "testfile*" -print |\
while read $file
do
   echo "put $file"
done )
 
ftp -nv<<EOF
open <<IP address of the windows system>> <<EOF
user username Password
ASC
$files
bye
EOF

Do I need to open any firewall or to install a third party software.

Last edited by Franklin52; 10-24-2011 at 08:30 AM.. Reason: Please use code tags, thank you
# 2  
Old 10-24-2011
You can test the ftp port is opened or not on the windows server. With this, you can make sure, if the firewall is opened and if the ftp service is started

Code:
login your unix box
telnet WINDOWS_HOSTNAME 21

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with a script to transfer files from Solaris to windows

Hi Please can you tell me what could be wrong with the following scriptto transfer files from solaris 10 to windows machine: #!/bin/sh HOST=<IP> USER=administrator PASSWD=xyz123zyx /usr/bin/ftp -inv <<EOF connect $HOST user $USER $PASSWD cd Documents binary mput *.sh bye EOF (23 Replies)
Discussion started by: fretagi
23 Replies

2. Shell Programming and Scripting

Script to transfer files from Solaris to windows

Hi All Please can you help, I´ve wrote the following script on a solaris 10 server to transfer files to a windows machine. #!/usr/bin/sh cd /moneta_polled01/download HOST=10.100.4.72 USER=user1 PASSWD=V7stop /usr/bin/ftp -v $HOST <<EOF user $USER $PASSWD cd tmp binary put... (7 Replies)
Discussion started by: fretagi
7 Replies

3. Windows & DOS: Issues & Discussions

Cygwin script to transfer file from windows to UNIX

Hi, Objective is to transfer files from windows server to Unix server using cygwin. I have installed cygwin, and I manually execute commands and transfer files from windows to unix using sftp. These are steps I execute 1) Run cmd 2) Run cygwin 3) At prompt type sftp user1@uniserver 4) lcd... (2 Replies)
Discussion started by: wahi80
2 Replies

4. Shell Programming and Scripting

Unix shell script to delete files on windows server

Hi experts, can anyone suggest me on the below: how to write a shell script to search and delete files on windows server. -script runs on unix box -it should search for specific files on windows server and delete them periodically. (2 Replies)
Discussion started by: chpradeepch
2 Replies

5. Shell Programming and Scripting

shell script to ftp the files from windows to unix server

Hi, I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine. Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the... (10 Replies)
Discussion started by: kavithakuttyk
10 Replies

6. UNIX for Advanced & Expert Users

Shell script to ftp files from windows to unix

Hi , I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine.Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the forum i... (1 Reply)
Discussion started by: kavithakuttyk
1 Replies

7. UNIX for Advanced & Expert Users

How to transfer files from Unix to Windows.

Hi There is a requirement for me to transfer files from Unix to windows in an automation process of unix. Please let me know is it posibble to shell scripting this? Could you help me in scripting it? Regards Venugopal (2 Replies)
Discussion started by: venu_eie
2 Replies

8. Shell Programming and Scripting

shell script to transfer files from Unix to Windows

I need to write a shell script to transfer files from Unix server to windows machine. This script will be scheduled on scheduler to run at specified intervals #!/bin/ksh ftp -n alaska <<End-Of-Session user sss01 sample cd /home/sss01 lcd D:/sample mget *.txt bye when I executed the... (15 Replies)
Discussion started by: knag
15 Replies

9. UNIX for Dummies Questions & Answers

Transfer files from Unix server to Windows using FTP

Dear Friend, I don't know much about unix.I am an VB6.0 Programmer.I need to move an text files as aaa.txt from unix server to windows "D: " driver using the FTP protocol.Is it possible to do this with help of unix shell script.If possible please give some sample codes. Please answer as early... (1 Reply)
Discussion started by: gjsaravanan
1 Replies

10. Shell Programming and Scripting

transfer of files via ftp from windows to unix

I am currently looking to write a script to transfer files from a windows NT server to a unix server any ideas of how to go about this? (1 Reply)
Discussion started by: chambala5
1 Replies
Login or Register to Ask a Question