Is their Automatic command to send a JPG file using FTP

Polytropon freebsd at
Fri Jan 29 10:46:57 UTC 2010

On Thu, 28 Jan 2010 13:39:38 -0800, "Dixit, Viraj" <Viraj.Dixit at> wrote:
> Hi,
> The script that I have setup does not work if I run the .netrc file. I
> ran the commands in ftp -v mode and it did not like machine command, did
> not like passwd or pwd etc. 

Did you issue the command

	% ftp -v

(where refers to the "machine" identifier in .netrc)?

> machine
> login VJ
> password  123456
> macdef init
> binary
> lcd /ftp
> cd /var/temp
> get newemp.db
> quit

Looks valid to me, but you could do this more easily, at least
for testing:

	% cd /var/temp
	% ftp VJ:123456 at

This should get you the file into the correct directory.

> If I use this command in .netrc it connects to the server but it does
> not connect using my login name VJ, it  points to some other name.
> ftp <ftp://ftp> 

That's not the correct way to call the ftp program.

>  .netrc simply doesn't work in FreeBSD.

For sure it does, as described in the manpage.

> Is their someone who has a working script. Thanks!!!

See my example above.

At the moment, it doesn't seem that you "send" a file per
FTP, but "receive" one. This can also be achieved through
the .netrc file, but to make sure everything works ON BOTH
SIDES of the connection, try the ftp command given above
where the needed information is "hardcoded". You can add
the -v parameter, too.

If you require more help, describe more exactly what you're
intending to do.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list