From owner-freebsd-questions Sat Nov 4 13:32:29 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id 1505637B479 for ; Sat, 4 Nov 2000 13:32:27 -0800 (PST) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id PAA28981; Sat, 4 Nov 2000 15:35:56 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Sat, 4 Nov 2000 15:35:56 -0600 (CST) From: Ryan Thompson To: joe Cc: freebsd-questions@FreeBSD.ORG Subject: Re: FTP (auto-fetch) In-Reply-To: <000801c04633$37fbd020$4b02000a@popidols.net> Message-ID: Organization: SaskNow Technologies [www.sasknow.com] MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG joe wrote to freebsd-questions@FreeBSD.ORG: > Dear sir/Madam > > I've been trying to use the ftp (auto-fetch) command: > ftp ftp://[user:password@]host[:port]/file[/] > > As I found, the default file transferring operation of this > instruction is eqivalant to a ftp's "get" command, but actually I want > this command to perform a ftp's "put" command and do it automatically. > Therefor, are there any options or parameters I have to add to make it > works? Actually, ftp(1) doesn't support this sort of command line operation. Some time ago (FreeBSD 2.2.x, I think), I patched ftp(1) to support a put if two arguments were given. (Worked for single files). Probably better is to write a .netrc in your home directory. For example: machine ftp.host.com login yourname password yourpassword macdef init put /path/to/local.file ./remote.file quit Then, from the command line $ chmod 600 .netrc $ ftp ftp.host.com You MUST chmod 600 this file so that it is not readable by others (otherwise, ftp(1) will complain that you have a world-readable password) When you execute `ftp ftp.host.com`, ftp(1) will read .netrc, find your login and password for ftp.host.com, and do the contents of the "init" macro, which uses "put" to upload a file, then quits. You could leave out the quit, and ftp(1) would be left in interactive mode. Hope this helps! - Ryan -- Ryan Thompson Network Administrator, Accounts Phone: +1 (306) 664-1161 SaskNow Technologies http://www.sasknow.com #106-380 3120 8th St E Saskatoon, SK S7H 0W2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message