From owner-freebsd-questions Sun Aug 26 9:46:48 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailin3.email.bigpond.com (juicer24.bigpond.com [139.134.6.34]) by hub.freebsd.org (Postfix) with ESMTP id D6C9937B401 for ; Sun, 26 Aug 2001 09:46:42 -0700 (PDT) (envelope-from rmoss@bigpond.net.au) Received: from spiral.bigpond.net.au ([139.134.4.51]) by mailin3.email.bigpond.com (Netscape Messaging Server 4.15) with SMTP id GIOPJZ00.JSE; Mon, 27 Aug 2001 02:52:47 +1000 Received: from CPE-144-132-3-53.vic.bigpond.net.au ([144.132.3.53]) by mail7.bigpond.com(MailRouter V2.9g 15/12675971); 27 Aug 2001 02:46:27 Message-Id: <5.0.2.1.0.20010827023915.00a9ae58@localhost> X-Sender: rmoss/pop-server.vic.bigpond.net.au@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.0.2 Date: Mon, 27 Aug 2001 02:42:20 +1000 To: jacks@sage-american.com, freebsd-questions@freebsd.org From: Robert Moss Subject: Re: FTP Auto-Send Need In-Reply-To: <3.0.5.32.20010826102823.01151810@mail.sage-american.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I would use ncftp (version 2/3) which has 'ncftpput' and 'ncftpget' to log in and upload a file via scripting. Also, in the past people have automated things like TFTP using the following examples /usr/bin/ftp <<_END_ open host.com lcd /tmp cd /pub/somewhere get file.tar.gz exit _END_ Cheers rob. At 10:28 AM 26/08/2001 -0500, jacks@sage-american.com wrote: >I have an FTP question that is probably simple for some, but is maddening >for me since I have yet to get an FTP command (and a script) to work >properly. I have read/reread "man ftp", but no solution yet. Here is the >problem: > >Here is the simple process needed: >#ftp ftp.remotehost.com >#auto-login (useracct/userpasswd) >#cd /remote.dir >#put myoutfile >#bye >#finished > >That's all I need to do....!!!! > >This needs to run unattended through cron or from within a script. > >By configuring the ".netrc" file, I can auto-logon to the remote host in >anonymous mode, but not to the user account. Further, I would need to "cd" >to the "incoming" directory to upload anyway. Also, when the cron job >issues the command to "ftp ftp.remote.com", it WILL login anonymously and >then just sits there without continuing to run the local script calling for >a "cd" and upload of "myoutfile". So, no upload of "myoutfile" is possible >without some sort of script than continues the process. > >Now, here is my ".netrc" file: > >************************** >machine ftp.remotehost.com > anonymous > >macdef (nothing in here yet) >************************** > >I've tried this instead to go in as user account: > >************************** >machine remotehost.com (and tried "ftp.remotehost.com) > mypasswd >macdef (nothing in here yet) >************************** >That second "netrc" config tells me to go away, ....others can see my >password!!!!! > >Also, I assume the "macdef" means "macro definition" (wild guess) and there >is where I may need a macro to run to finish the upload.... or a command >line would be used to call the macro to issue the whole thing. > >I had some help on this from "Edwin" of this list, but am still >struggling... any others that can lend a hand on this to give more >clarification? I just want to find a way to send that darn file back to the >remote. Thanks in advance for any ideas that my thick head can >understand..... > >Best regards, >Jack L. Stone, >Server Admin > >Sage-American >http://www.sage-american.com >jacks@sage-american.com > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message