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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pull a file from a remote server through a shell script sashankkrk UNIX for Dummies Questions & Answers 2 04-23-2008 05:13 PM
Script runs fine on UNIX Server...Not through MSK Tool kit on Windows Server madhunk UNIX for Dummies Questions & Answers 5 01-31-2008 01:30 PM
Shell Script to ftp from windows server shilpa.rajput Shell Programming and Scripting 8 11-07-2007 12:52 AM
Move root disk to new server VirginiaSA SUN Solaris 18 05-20-2005 06:48 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-27-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt
i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this?

thanks in advance! Im a newbie to this...
  #2 (permalink)  
Old 10-27-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Did you have a look at the forums' FAQ ?

Here is a link - Automate FTP / Scripting FTP Transfers
  #3 (permalink)  
Old 10-27-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
ok thanks! however, now i need to put all the text files in a directory over to the other server. The directories contains other files beside text files. i only need to put text files. I now only manage to put a single text file to the other server. I also have error in my coding.....

Heres my coding:
set FILENAME = /local/filename.log

ftp -v -n "myipadd" << cmd
user "user" "passwd"
cd /remote/FTP
lcd /local/ ssh_install

ls -1 *.txt $local_path > $FILENAME

put $FILENAME
quit
cmd
  #4 (permalink)  
Old 10-27-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
You can use mput *.txt

Before doing that, you need to turn off the interactive mode of FTP. Just use prompt before doing the mput.
  #5 (permalink)  
Old 10-27-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
Thanks vino! the script is working fine now :P
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0