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
# 8  
Old 07-12-2006
Quote:
Originally Posted by amon
I created also script to transfer file from UNIX to WIn.but I had to set up ftp directory in windows(IIS) so I can just put my files in that directory..

I would also love to see is it possible to use lcd command so I could change windows directory in my unix script???

It that possible??
You still haven't answered my questions... Where are you running the script (Windows or Unix)? Where is the FTP server (Windows or Unix)?
# 9  
Old 07-13-2006
that script is on UNIX...something like a script knag mention...

and is there a way to change dir.from unix...fo change dir.where unix script transfers files...
# 10  
Old 07-13-2006
Shouldn't the slash be of the other type. The palce where u are specifying lcd would be D:\sample. and since the script is on Unix
cd D:\sample
and
lcd /home/sss01
# 11  
Old 07-13-2006
OK I am posting whole script...

on UNIX:
ftpscript:

#!/bin/ksh
#Usage example: ftpscript readme.txt /pub/dir1/readme.txt
localFile=$1
remoteFile=$2


ftplog=loglog.log
echo "$(date "+%H:%M:%S") - Attempt to FTP $1 to $2" > $ftplog

# do the FTP put

ftp -i -n <<EOF >> $ftplog
open <hereIPaddress>
user someuser somepass
put $localFile $remoteFile
ls $remoteFile
quit
EOF


./ftpscript localfile.txt
so by entering IP of my windows machine and execution of this script file goes to windows...and this works..but file goes to my directory I specified in IIS I was wondering can I tell in UNIX script where to place file when it is transfer from U. to W.??

Thanks for answers..
# 12  
Old 07-13-2006
I think it "lcd directory" name
# 13  
Old 07-13-2006
I'm trying to find a way to subit a quote command from a unix ftp scrip to an as400. How do i do this?
# 14  
Old 07-13-2006
kang tried with lcd command ...it did not worked...
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 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.... (1 Reply)
Discussion started by: vsachan
1 Replies

6. 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

7. 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

8. 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

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