No ftp command in debian linux

Geronimoe

Inactive User
Joined
Nov 22, 2004
Messages
397
Reaction score
8
Location
Usually in a hole
Hiya, hoping someone can help because i am at my wits end with this.
I am a beginner with linux and i am setting up a web server using debian and apache.
I have installed a ftp client Proftpd, which is working fine but my problem is i am writing a script to transfer files automatically to another computer.
In the script i am using the command " ftp " but comes up with
ftp: command not found

Any help would be appreciated

Geronimoe:licka::Kickassro
 
I don't use debian, but I'd be VERY surprised if there's no 'ftp' command. It's standard on all distros I've ever used. I think it's more likely you've just not got it in your path, or the PATH variable within your script isn't set up properly. Check from the command line to see if it exists. I'd guess it's in /usr/bin. Alternatively, use 'wget' which will handle simple ftp transfers.

By the way, proftpd is an ftp server, not a client.
 
Hiya,

I tried the wget command and that works fine in debian but could you tell me how to use wget in the command line structure for the script below.

fi
if [ -e "/update/line.txt" ]
then
ftp -n -u $IPADDRESS <<End-Of-Session
user root "$lOGINNAME"
bin
hash
cd "$DIRECTORY"
lcd "$DIRECTORY"
put file.bin
bye
End-Of-Session
echo "complete"
else
echo "Not Required"
fi
exit


#this is the section of script which rtns ftp command not known#
Thanks for the heads up on the PROFtpd, takes a while to grasp all this new terminology.

Geronimoe

PS: I have checked in the usr/bin and can not see a ftp application in there so i think i need to download one.
 
Last edited:
your trying to write a shell script to put a file somewhere?

wget wont work for you if that is the case as it is a command to fetch a file to you. Tell me, where are you trying to send the file to?
 
The file is being transfered to a dreambox on the localhost
I assumed wget only fetched files but being a noob at linux i was not sure so asked the question.
 
Last edited:
no worries, i think in this instance wget wont be much used to you.

can you use windows to ftp the file over to the box? from the look of your scipt - you want to to this to a number of boxes at once?

An alternative is cp or scp to copy the file from your linux box onto the dreambox. Scp would probably be best it goes something like scp <path to your file> user@host:<path to dest>

can you let me know where you get the variables for $IPADDRESS etc?
 
karym6 is right, my idea about wget is pointless, although in my defense, I think it's reasonable to assume from your first post you wanted to download something. lol. Anyway, I still can't believe there's not 'ftp' command in debian. Have you tried direct from the command line? And have you got a '#!/bin/sh' at the top of your script?
 
it is possible that the ftp client isnt started, i dont use debian so I am not sure about this one.

imo, Debian is the least user friendly linux on the planet.

geronimoe, can you also type perl -v and ruby -v on the command line (one after the other) and let me know what you get? There are other ways to ftp, and as you are using linux, this may be quite simple :)
 
Hiya will give that a go later,
cheers for your help,

I have set the variables at the beginning of the script, the script runs fine until it hits the ftp command but looks like on my distro it is not working so first going to try and reinstall ftp application.
Will get back with a heads up later.

Info for previous post

this is perl. v5.8.8 built for i486-linux-gnu-thread-multi
 
Last edited:
ok, no worries.

Hopefully you have perl or ruby installed, if so you can use either of them to send files via ftp.

Basically, in ruby it looks like this:

require 'net/ftp'

ftp = Net::FTP.new('<your dreambox address')
ftp.login(user = "<your login name variable", password = "<your password variable")
files = ftp.chdir('<put your dest vairable here')
ftp.put (<path to your file>, <dest>)
ftp.close

I notice from your code snippet you appear to have a file, line.txt - does this contain info you need to use in order to to connect? If so, you can have ruby read the file line by line etc.

If you have time, post your whole script so we can see what it does.
 
i dont think you have a command-line ftp client installed,
on my mandriva box (typing this message on it) i just type "ftp" in a shell and im in a command-driven ftp app.
 
Ther isn't an 'ftp client service', and it certainly doesn't need to be started. Only server services need to be started. In this case, this means ftpd on the dbox. I stand by my previous solution that the ftp client 'ftp' just isn't in the PATH variable.
 
hmm, not sure about it not being present in the path - if that were the case a few other things wouldnt work..

ftp is normally installed with linux - as I said before its pretty much a constant and nearly every operating system comes with one (after a fashion). you can look at your path by typing echo $PATH in a console window - if you know where your ftp client is installed you can add the directory to your path by doing this:

~% PATH=/path/to/ftp/dir:$PATH

alternatively - you can get an installer for your version of linux - I have no idea what debian you are using ( can you let us know) but you should be able to use yum or apt to get one installed. Let me know what version you have installed and I can give the command. Its either going to be yum install ftp or apt get install ftp (if you have a decent distro)

Also, you will need to be su to get this installed (should it be missing)
 
su to root and type the following

updatedb

This will update the index of files on your hdd. You can then use the locate command to find where it is e.g.

locate ftp

if that yeilds nothing then you might not have it installed. IIRC Debian uses apt so to install you would type

apt-get install ftp

Can I recommend ncftp over "normal" ftp, its far better with better feedback on download and also supports command line completion.

HTH

p.s.

If you still have problems, type

uname -a

and post that back in your response so we know exactly what you are running
 
Last edited by a moderator:
Looks very much like a PATH issue. find the ftp client first with:
ls -l `find / -name=ftp`
(cut and paste the command.....the "back-ticks"-` are NOT apostrophies-' )

look for '-rwxr-xr-x' in the first column (all the 'x's mean that the file is executable i.e. a program)

use the full path with leading "/" in yout script.

If the find command can't find ftp, then it's not installed (most unusual)
 
Back
Top