The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Pulling a list of files from FTP site in a shell script spatra Shell Programming and Scripting 0 08-28-2008 07:03 AM
Download files using perl mirusnet UNIX for Dummies Questions & Answers 2 12-19-2007 10:04 PM
how to browse a web site using script kirantalla AIX 4 10-15-2007 03:56 AM
download files from direct links tool? umen UNIX for Dummies Questions & Answers 2 07-04-2006 10:00 AM
shellscript for download files ram2s2001 Shell Programming and Scripting 3 02-07-2006 08:16 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2008
tiff-matt tiff-matt is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
script for download files from ftp site

I'm new to scripting. I'm trying to write a script to download files from ftp site, the following is the script and the message i get after running the script. no files were downloaded
Thanks advance!

script:
#!/usr/bin/ksh
DAY=`date --date="-1 days" +%y%m%d`
ftp -v -n "ftp.address" << cmd
user "user name" "pass word"
cd /directory
prompt
bin
mget $DAY*
quit
cmd

Message after running the script:

Connected to lnxftp.mer.com.
220 Welcome to the Mer FTP Service.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
Interactive mode off.
200 Switching to Binary mode.
221 Goodbye.
  #2 (permalink)  
Old 09-18-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,390
try this....
Quote:
ftp -inv "ftp.address" << EOF
quote user username
quote pass password
.
.
.
  #3 (permalink)  
Old 09-18-2008
tiff-matt tiff-matt is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
Thanks for your help. It works now.
  #4 (permalink)  
Old 09-19-2008
tiff-matt tiff-matt is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
the following script works yesterday, but today does not work any more, what's wrong with it. after run it, it give me the same message as i posted before. please advise. thanks

#!/usr/bin/ksh
DAY=`date --date="-1 days" +%y%m%d`
ftp -v -n "fftp.address" << cmd
quote user username
quote pass password
cd /directory
prompt
bin
mget $DAY*
quit
cmd
  #5 (permalink)  
Old 09-19-2008
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,390
check the user name and password once again.. it might not be working.. try to login from command prompt..
  #6 (permalink)  
Old 09-19-2008
tiff-matt tiff-matt is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 6
Thanks vidyadhar85, I can manually log on the ftp with the same user and pass. still don't know why it worked only yesterday

Thanks
Sponsored Links
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 11:40 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