Is their Automatic command to send a JPG file using FTP

Polytropon freebsd at
Thu Jan 28 08:02:57 UTC 2010

On Wed, 27 Jan 2010 14:08:40 -0800, "Dixit, Viraj" <Viraj.Dixit at> wrote:
> Hi,
> I am looking to see if there a command or a script In BSD Os that will
> allow me to ftp to a server automatically and get a file from another
> server. User name and passwd will be already in the script so it will
> run ftp and download a file or a JPG from that server. Like in Linux OS
> there is a command using .netrc file and you can script that file and
> will automatically do what is in the file at time interval that you
> want.  Thanks,

In FreeBSD, there's documentation on that; read "man ftp" and
see the -u option.

I'm often (ab)using a Makefile to upload (send) files per FTP to
a server, and I call this "make install". You can put this into
a shell script (sh) and then call it, e. g.

cd ${UPLOAD} && ftp -u ftp://${FTPUSER}:${FTPPASSWD}@${SERVER} *

Of course, you can utilize .netrc to contain FTP access data. Then,
you just need to call "pure" ftp with server name, and you can
replace * with any file name(s) you want.

However, be aware that FTP doesn't encrypt passwords. You should
take into mind that using FTP with an SSH wrapper, or even
better - scp - is a more secure way to "send files".

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

More information about the freebsd-questions mailing list