From owner-freebsd-questions Wed Oct 9 14:38:43 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1144037B404 for ; Wed, 9 Oct 2002 14:38:42 -0700 (PDT) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1469343E6A for ; Wed, 9 Oct 2002 14:38:41 -0700 (PDT) (envelope-from metrol@metrol.net) Received: (qmail 13913 invoked from network); 9 Oct 2002 21:38:41 -0000 Received: from unknown (HELO metlap.priv.metrol.net) ([66.92.40.27]) (envelope-sender ) by mail16.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 9 Oct 2002 21:38:41 -0000 Content-Type: text/plain; charset="us-ascii" From: Michael Collette To: FreeBSD Mailing Lists Subject: Re: FTP gone weird Date: Wed, 9 Oct 2002 14:38:26 -0700 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200210091438.26928.metrol@metrol.net> 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 On the recommondation of an off list response I attempted using some other tools instead of "ftp". Tried fetch, wget, and even curl. wget didn't like the port forwarding, cron or not. Both fetch and curl work off the command line. They also don't produce an error when run from cron. Neither one is actually getting the file though. What in the heck is it about cron that goofs these ports up?? Later on, Michael Collette wrote: > Having a heck of a time with what I thought would be a pretty simple cron > job > of pulling down a web log via FTP. In the process, I've run into a wall > of port problems. > > The Scenario: > I'm running an ssh session looped back to itself so as to configure a > tunneled port forward from localhost:2121 to remoteserver:21 > > My cron job calls a small shell script that puts together the proper file > name to get for the day, then issues the following command... > > ftp ftp://${USER}:${PW}@${SITE}:${PT}${REMDIR}${FILE} > > The site and port vars are set to "localhost:2121" to go through the > tunnel. When I run this script from a command line, it works exactly as I > would > expect it to. From cron, I get the following error... > > Data connection to 127.0.0.1:49159 is not allowed when control connection > is from 10.10.10.10:3553! > > The from IP is faked for this example. The actual error has the routeable > IP > address of this box. The port numbers both increment on each attempt. > > The end goal here is to just automate an FTP download through an SSH > tunnel. The remote machine is not running sftp, nor do I have admin rights > to it. SSH forwarding is pretty much my only option there. > > Any ideas? > > Later on, -- "Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark to read." - Groucho Marx To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message