From owner-freebsd-questions@FreeBSD.ORG Thu Jan 28 19:10:24 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB05E1065670 for ; Thu, 28 Jan 2010 19:10:24 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 799DB8FC18 for ; Thu, 28 Jan 2010 19:10:24 +0000 (UTC) Received: from r55.edvax.de (port-92-195-188-34.dynamic.qsc.de [92.195.188.34]) by mx01.qsc.de (Postfix) with ESMTP id C023C3DAFD; Thu, 28 Jan 2010 20:10:21 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id o0SJAL1I005068; Thu, 28 Jan 2010 20:10:21 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Thu, 28 Jan 2010 20:10:21 +0100 From: Polytropon To: "Dixit, Viraj" Message-Id: <20100128201021.40b0e44c.freebsd@edvax.de> In-Reply-To: <9A8CAB63B4C2014B883AF16FDFB362FB01F016C7@xpo.staff.copa> References: <9A8CAB63B4C2014B883AF16FDFB362FB01F016C5@xpo.staff.copa> <20100128090254.7452a557.freebsd@edvax.de> <9A8CAB63B4C2014B883AF16FDFB362FB01F016C7@xpo.staff.copa> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Is their Automatic command to send a JPG file using FTP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2010 19:10:24 -0000 On Thu, 28 Jan 2010 10:21:32 -0800, "Dixit, Viraj" 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 ". 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, ...