LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 10: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, 11:26 AM   #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, 12: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, 01: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 03:44 AM.
 
Old 04-08-2008, 01: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:48 AM.

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
Open Source Consulting | Domain Registration