LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 04-08-2008, 11:46 AM   #1
quest4net
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Rep: Reputation: 0
FTP script


Hello All!

I'm trying to write a script that will ftp in and download some files. My problem is that this ftp host is not password protected and the files are not in the default path. I need to add a path past the root. How can I do this? When I type open root/directory I get unknown host. Help please! Thanks in advance!

--Nick
 
Old 04-08-2008, 12:26 PM   #2
3rods
Member
 
Registered: Mar 2008
Posts: 70

Rep: Reputation: 16
Can you post some of the script please?

Alternatively, why can't you log in anonymously to the FTP, set a "wait" in the script (to allow it enough time to log on) then do a "cd" to the directory you want (i.e. cd files/backup/) and then issue a "get" for the file(s) you want?

This might help too:
http://linux.about.com/od/commands/l/blcmdl1_ftp.htm
 
Old 04-08-2008, 01:50 PM   #3
quest4net
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for you help. I thought you had it, but it didn't work. At the root level it asks for a password.

It really isn't a script problem because I can't do it from a command line.
 
Old 04-08-2008, 02:19 PM   #4
prad77
Member
 
Registered: Mar 2008
Posts: 101

Rep: Reputation: 15
Below is the script usually used for FTP.
So if it not password protected , then i guess u can remove the line - "user <FTP_LOGIN> <FTP_PASSWORD>"

# do the FTP put

ftp -i -n <<EOF >> $mylog
open <FTP_HOST>
user <FTP_LOGIN> <FTP_PASSWORD>
put <localFile> <remoteFile>
ls <remoteFile>
quit
EOF

Gentoo

Last edited by prad77; 04-17-2008 at 04:44 AM.
 
Old 04-08-2008, 02:34 PM   #5
quest4net
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Original Poster
Rep: Reputation: 0
nick]$ ftp -i -n datalink.*.com/DataLinkOutput/NOM/NOM_1000175695/
ftp: datalink.*.com/DataLinkOutput/NOM/NOM_1000175695/: unknown host


The host is correct when you put it in the browser.
 
  


Reply

Tags
ftp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding FTP script chnlinux Linux - Newbie 2 07-17-2007 08:48 AM
FTP Script tommytomato Linux - General 28 07-14-2006 06:16 AM
FTP script the_imax General 6 12-30-2005 02:27 AM
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 07:57 PM
Ftp script scialom Linux - Software 2 05-04-2004 04:03 PM


All times are GMT -5. The time now is 05:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration