[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: where are ftp error messages logged?

On Mon, Oct 04, 1999 at 02:36:12PM -0500, Bill West wrote:
> On Mon, Oct 04, 1999 at 01:22:44PM -0600, David Karlin wrote:
> > Hello,
> > I've written a shell script that creates a file, then uploads it to my
> > ISP's server via (command-line) ftp.
> > 
> > After getting it to work from the (bash) command-line, I put it in
> > /etc/ppp/ip-up.d, so it would update this file every time my ppp link
> > goes up.
> > 
> > When run automatically (for example I run "pon"), it manages to write
> > the file on my (local) system, but the (scripted) ftp session fails,
> > and the file is not uploaded.
> > 
> > Here is a snippet of my script which contains the code for the ftp
> > session:
> > 
> > # setup networking defaults
> > /bin/cp /home/someuser/somefile/ ~/.netrc
> > 
> > # begin ftp session to upload file
> > /usr/bin/ftp -v -i home.myisp.com <<EOI
> > put /var/www/somefilehere www/somefilethere
> > quit
> > 
> > EOI
> > 
> > Why would this work from the (bash) command line, but not from
> > /etc/init.d/ip-up.d?  BTW, I've tried with #!/bin/sh and
> > #!/bin/bash.
> It could be that the script is trying to run before the link is all the way
> up and cannot make the connection. You could try throwing a sleep in there
> test this theory. Just guessing from some things along this line I was doing
> awhile back.

Hi again,
I tried adding a "sleep 9" right before beginning the ftp session, but it
didn't make any difference.  Maybe it needs a longer amount of time?

Since the file is written to my local machine with a link to the (correct)
current, dynamic IP address, I can't imagine that the link is not up when
that same file is uploaded to the server _later_ in the script.  In fact,
I added a line with "mail -s "script name" myuserid </somefilehere right
before, and right after, the ftp session part of the script.  Both messages
found their way to my inbox with the _correct_ dynamic IP address for ppp0.

It seems that everything in the script runs properly except the scripted
ftp session (which works fine from the command line).

Which brings me back to my original question:  Where are ftp error messages

Thanks for the interest.

PS:  Correct me if I'm wrong, but aren't the scripts in /etc/ppp/ip-up.d
supposed to run only _after_ the ppp link is established?

David Karlin
Powered by Debian GNU/Linux 2.1

Reply to: