Date: Mon, 27 Aug 2001 02:42:20 +1000 From: Robert Moss <rmoss@bigpond.net.au> To: jacks@sage-american.com, freebsd-questions@freebsd.org Subject: Re: FTP Auto-Send Need Message-ID: <5.0.2.1.0.20010827023915.00a9ae58@localhost> In-Reply-To: <3.0.5.32.20010826102823.01151810@mail.sage-american.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.0.2.1.0.20010827023915.00a9ae58>