Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-08-2008, 10:46 AM   #1
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!

Old 04-08-2008, 11:26 AM   #2
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:
Old 04-08-2008, 12:50 PM   #3
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, 01:19 PM   #4
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>
put <localFile> <remoteFile>
ls <remoteFile>


Last edited by prad77; 04-17-2008 at 03:44 AM.
Old 04-08-2008, 01:34 PM   #5
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.



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 07:48 AM
FTP Script tommytomato Linux - General 28 07-14-2006 05:16 AM
FTP script the_imax General 6 12-30-2005 01:27 AM
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 06:57 PM
Ftp script scialom Linux - Software 2 05-04-2004 03:03 PM

All times are GMT -5. The time now is 12:39 AM.

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