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


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

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-22-2006
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
FTP script

Hi,

I want a small help . my requirement is to write a script which will make a FTP connection to one server ( called a.a.a.a) and gets file from there and print all the logs in one file .

I wrote it long back but noe can not recall.
thanks
Sponsored Links
    #2  
Old 09-22-2006
blowtorch's Avatar
AFK
 
Join Date: Dec 2004
Location: UK
Posts: 2,351
Thanks: 0
Thanked 6 Times in 6 Posts
Search this site for ftp scripts. And if you've written a script once, you can definitely write it again. Do *not* expect to just sit back and have other people write scripts for you.
Sponsored Links
    #3  
Old 09-22-2006
Dhruva's Avatar
Registered User
 
Join Date: Mar 2006
Location: India
Posts: 255
Thanks: 0
Thanked 1 Time in 1 Post
Here is one thread for ftp script.
Ftp Script
if you face any issue get back to us.
    #4  
Old 09-25-2006
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
I am seeing the below problem

Connected to 10.114.106.167.
220 (vsFTPd 1.2.0)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (10.114.106.167:rishir):

while my code is as below
#!/bin/bash
SERVER=10.114.106.167
USER=abc
PASSWD=abc

ftp $SERVER
user $USER $PASSWD
mkdir PPL
hash
bin
put ftp.sh
bye

ftp.sh = one script which I want to put on the destination server .


Could you please help me on this.
Sponsored Links
    #5  
Old 09-25-2006
Dhruva's Avatar
Registered User
 
Join Date: Mar 2006
Location: India
Posts: 255
Thanks: 0
Thanked 1 Time in 1 Post

Code:
#!/bin/bash
SERVER=10.114.106.167
USER=abc 
PASSWD=abc 

ftp -in $SERVER<<EOF
user $USER $PASSWD
mkdir PPL
cd /path of remote dir
lcd /path of local dir
hash
bin
put ftp.sh
bye
<<EOF

Sponsored Links
    #6  
Old 09-25-2006
Registered User
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Thank Q , its working fine.
Sponsored Links
    #7  
Old 09-27-2006
Registered User
 
Join Date: Jan 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Hi all, i followed the thread and modified the discussed solution.
My purpose is to ftp 2 files from a remote server to a local directory. Is my code below correct? i can't try it now because i do not have access to my servers yet.
would appreciate if anyone can let me know if there is any problem with my code.
Code:
SERVER=222.444.333.00
USER=abc 
PASSWD=abc 

ftp -in $SERVER<<EOF
user $USER $PASSWD
cd /path of remote dir where file resides
lcd /path of local dir where i want the file to be
text 
get target.file1
get target.file2
bye


Last edited by new2ss; 09-27-2006 at 02:02 AM..
Sponsored Links
Closed Thread

Tags
automated login, ftp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with shell script - Calling a script through script Siddheshk Shell Programming and Scripting 0 04-18-2011 05:14 AM
create a shell script that calls another script and and an awk script magikminox Shell Programming and Scripting 0 06-26-2008 02:50 AM



All times are GMT -4. The time now is 12:34 PM.