Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2002 12:36:11 -0600
From:      John <john@starfire.mn.org>
To:        Matthew Seaman <matthew@FreeBSD.ORG>, freebsd-questions@FreeBSD.ORG
Subject:   Re: FTP and cron
Message-ID:  <20021115123611.A83141@starfire.mn.org>
In-Reply-To: <20021115173059.GA48777@happy-idiot-talk.infracaninophi>; from m.seaman@infracaninophile.co.uk on Fri, Nov 15, 2002 at 05:30:59PM %2B0000
References:  <20021115103931.A82781@starfire.mn.org> <20021115173059.GA48777@happy-idiot-talk.infracaninophi>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 15, 2002 at 05:30:59PM +0000, Matthew Seaman wrote:
> On Fri, Nov 15, 2002 at 10:39:31AM -0600, John wrote:
> 
> > No, it's not something simple like cron not running expect, or ftp
> > being in "non-interactive mode".  The prework all runs correctly,
> > I even set the hash byte count and get the feedback from that...
> > when the put command starts, though, things get different!  I get
> > different progress messages, no hash marks, and apparently, no
> > data transferred.  The file NAME appears on the remote side, but is
> > 0 length regardless of how long I wait.  When I run the scripts
> > from the terminal, it works fine.
> 
> When you're running from cron(8) you get a very limited environment.
> You won't get a tty assigned to you, and the $TERM environment
> variable won't be set.  That makes it difficult for ftp(1) to do any
> of the screen control things you may be expecting.

Well, I think that "expect" takes care of that, since it assigns
a pty, and I had set TERM in an act of desparation...

> Stuff like $FTP_PASSIVE_MODE, which is often set out of
> /etc/login.conf, won't be configured either.  Actually, on reflection
> the symptoms you describe sound like ftp(1) active mode breakage to me
> --- you tend to get that if you're running a firewall on the client
> end of the ftp connection.  Try using pftp(1) or equivalently,
> supplying the '-p' flag on the ftp command line.

WOW! Bingo!  This was it.  Works great now.

The answer brings up almost as many questions as it answers, though.

I understand ftp active and passive mode, but why...

Never mind.  You nailed that, too.  Precisely correct, doctor!
FTP_PASSIVE_MODE=YES is right there in /etc/login.conf.  When I
upgraded to FreeBSD 4.3 AND changed my firewall at the same time,
the changes canceled each other out.  The differences in the
FTP dialog stayed below my visual filter threshold.

Everything now works perfectly.  As someone who has taught others
the differences between ftp active and passive mode, I am doubly
chagrinned that I so adamantly refused to acknowledge the truth
so blatantly before me.  When I went back and looked at those
two outputs I mailed, well, wow, that should have been screaming
at me, and I missed it.

Thank you all for your patience, thank you all for your time,
and thank you that it works, and I understand how/why/wherefore!

That doesn't happen every day, you know...
-- 

John Lind
john@starfire.MN.ORG

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?20021115123611.A83141>