Is their Automatic command to send a JPG file using FTP

Polytropon freebsd at edvax.de
Thu Jan 28 19:10:24 UTC 2010


On Thu, 28 Jan 2010 10:21:32 -0800, "Dixit, Viraj" <Viraj.Dixit at CityofPaloAlto.org> wrote:
> Thanks so much. One question, I created a .netrc file and put it in the
> root (/root) directory and this is what it looks like below. I have
> taken out the IP, user name & password so no body can use them.

Do you regularly work as root? :-)



> Can you
> tell me if my syntax is correct [...]

Check "man ftp", there's a whole section "THE .netrc FILE".
I know that the ability to rely on manpage information isn't
very common in Linux land due to missing documentation
quality. :-)



> [...] and how do I activate this file and is
> this file in the right place on the server.

The syntax is "ftp -N <file>". The default is ~/-netrc.



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

That looks okay to me. You can process it with "ftp -v"
to check verbose output for any strange things, should they
ever happen.

In order to avoid interaction (especially when working
with more than one file), you could add "prompt" to supress
any manual input.

By the way, FreeBSD's ftp program accepts stdin input,
such as

        printf "prompt\nmdelete *\nbye\n" | \
	ftp ftp://$(FTPUSER):$(FTPPASSWD)@$(SERVER)/

This is what I call "make deinstall" for web pages. :-)

This means that you could do the same as with .netrc.



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


More information about the freebsd-questions mailing list