The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Transfer files from Unix server to Windows using FTP gjsaravanan UNIX for Dummies Questions & Answers 1 08-22-2005 04:55 PM
ftp files from Unix to Windows through shell program whatisthis Shell Programming and Scripting 7 05-04-2005 06:28 AM
FTP Shell Scripts from Windows to Unix: files have exotic characters Laud12345 Shell Programming and Scripting 4 02-17-2005 02:57 PM
transfer of files via ftp from windows to unix chambala5 Shell Programming and Scripting 1 11-09-2004 07:33 AM
Trying to transfer b/w Unix and Windows dirtysparks UNIX for Dummies Questions & Answers 6 09-23-2003 10:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2006
Registered User
 

Join Date: Jul 2006
Posts: 2
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 above shell script. It throws error saying file location D:/sample not found.
Can somebody please help me in writing the script?
Reply With Quote
Forum Sponsor
  #2  
Old 07-11-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
Quote:
Originally Posted by knag
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 above shell script. It throws error saying file location D:/sample not found.
Can somebody please help me in writing the script?
You code should contain the terminating here-document End-Of-Session

Code:
#!/bin/ksh
ftp -n alaska <<End-Of-Session
user sss01 sample
cd /home/sss01
lcd D:/sample
mget *.txt
bye
End-Of-Session
Reply With Quote
  #3  
Old 07-11-2006
Registered User
 

Join Date: Jul 2006
Posts: 2
Hi Vino,

Thanks for you reply!
I added the EOF statement at the end. Now the session the coming out of ftp. but the error 'D:/Nagaraj: No such file or directory' still exists
can you please help..
Reply With Quote
  #4  
Old 07-11-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
Quote:
Originally Posted by knag
Hi Vino,

Thanks for you reply!
I added the EOF statement at the end. Now the session the coming out of ftp. but the error 'D:/Nagaraj: No such file or directory' still exists
can you please help..
Hmmm... Drop the ':' to make it D/Nagaraj
Reply With Quote
  #5  
Old 07-11-2006
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
It's complaining about the "lcd" command, telling the local system (that's running the FTP script) to change directory (as opposed to changing the directory on the FTP server.)

That looks like a Windows path to me (D:\sample). But your script is calling /bin/ksh. Are you on a Windows box, a Unix box, or a Windows box with SFU or Cygwin installed?
Reply With Quote
  #6  
Old 07-12-2006
Registered User
 

Join Date: Jan 2006
Posts: 71
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??
Reply With Quote
  #7  
Old 07-12-2006
Registered User
 

Join Date: Jun 2005
Posts: 4
How do i issue an command via FTP to an AS400 from an unix platform

Help
How do i issue an command via FTP to an AS400 from an unix platform?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
autosys, sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0