From owner-freebsd-questions@FreeBSD.ORG Fri Jan 29 10:46:57 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 CFA0B106566B for ; Fri, 29 Jan 2010 10:46:57 +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 8D6278FC1A for ; Fri, 29 Jan 2010 10:46:57 +0000 (UTC) Received: from r55.edvax.de (port-92-195-104-232.dynamic.qsc.de [92.195.104.232]) by mx01.qsc.de (Postfix) with ESMTP id B26113DCA8; Fri, 29 Jan 2010 11:46:55 +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 o0TAktv5001507; Fri, 29 Jan 2010 11:46:55 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Fri, 29 Jan 2010 11:46:55 +0100 From: Polytropon To: "Dixit, Viraj" Message-Id: <20100129114655.31700ac8.freebsd@edvax.de> In-Reply-To: <9A8CAB63B4C2014B883AF16FDFB362FB01F016CD@xpo.staff.copa> References: <9A8CAB63B4C2014B883AF16FDFB362FB01F016C5@xpo.staff.copa> <20100127225334.GX50360@dan.emsphone.com> <9A8CAB63B4C2014B883AF16FDFB362FB01F016CD@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: Fri, 29 Jan 2010 10:46:57 -0000 On Thu, 28 Jan 2010 13:39:38 -0800, "Dixit, Viraj" 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 0.0.0.0 (where 0.0.0.0 refers to the "machine" identifier in .netrc)? > machine 0.0.0.0 > 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@0.0.0.0/ftp/newemp.db 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 0.0.0.0 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. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...