RE: [SLUG] FTP transfer

2001-07-04 Thread Jill Rowling

I do something similar with .netrc (without the last 2 parameters though).
I create the ftp script (/tmp/myscript$$) on the fly, then
/bin/ftp remotemachine  /tmp/myscript$$
and I don't remove /tmp/myscript$$ until ps (in the calling script which is
run by cron) shows that the ftp process has finished.
As this runs in a cron job I have output redirected in the crontab, no need
to do it in the script if you are prepared to check your mail.

One other thing you might want to do is put full paths for everything as
your cron environment might not be the same as your normal login
environment, so the paths for executables might be different.

(/bin/ftp is the path for old Solaris 2.5.1, just put in the correct path
for your installation)

There are probably lots more ways to do it, but I think the environment is
the difference in your case.

Regards,

Jill.

-- 
Jill Rowling, Snr Des. Eng.  Unix System Administrator
Eng. Systems Dept, Aristocrat Technologies Australia
3rd Floor, 77 Dunning Ave Rosebery NSW 2018
Phone: (02) 9697-4484 Fax: (02) 9663-1412 Email: [EMAIL PROTECTED]
 


 -Original Message-
 From: Alister Waller [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 5 July 2001 9:45
 To: Slug
 Subject: [SLUG] FTP transfer
 
 
 I am trying to set up an automatic FTP transfer each night.
 
 I am using the .netrc config file and for testing the 
 contents are (names
 machine 123.123.123.123 login loginname password mum macdef init
 


--
CONFIDENTIALITY NOTICE
--
This email is intended only to be read or used by the addressee.
The information contained in this e-mail message may be confidential
information. If you are not the intended recipient, any use, interference
with, distribution, disclosure or copying of this material is unauthorised
and prohibited. Confidentiality attached to this communication is not waived
or lost by reason of the mistaken delivery to you.

If you have received this message in error, please delete it and notify us
by return e-mail or telephone Aristocrat Technologies Australia Pty Limited
on +61 2 9413 6300.

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



Re: [SLUG] FTP transfer

2001-07-04 Thread Mike Holland

On Thu, 5 Jul 2001, Alister Waller wrote:

 Now, when I run this using a cron job:
 my log file consists of
Interactive mode off.

So it looks like you script is being run. Does ftp connect to the server?
 If something fails under cron, suspect environment vars.
Add something to the script to log them. But in this case, I dont think
so.
  Another difference is the lack of a controlling terminal. Ftp uses
terminal features. Nothing about that in the man page though. I recommend
trying a different FTP client. There are others around, and some are much
better,  e.g. ncftp, wget.

  Also, in scripts, crontabs, etc, remember to use full paths for
commands.

-- 
Mike Holland  [EMAIL PROTECTED]
  --==--



-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug



RE: [SLUG] FTP transfer - SOLVED

2001-07-04 Thread Alister Waller


By inserting a few echo commands and seeing what was going on when the
script was run I came up with the following:


If I removed prompt from the .netrc file and called ftp with a -i -v switch
it all worked fine.


thanks for those that replied.

Alister



 I am using the .netrc config file and for testing the contents are (names
 and addresses changed to protect the innocent):

 machine 123.123.123.123 login loginname password mum macdef init
 bin
 prompt
 cd /ps_in/pbcp/eaqr
 cd /ps_in/pbcp/eavr
 quit

 I Call this from another little script (ftptransfer) using the line

 **SNIP***

 ftp 125.21.70.189  $DATAAREA/log/logfile

 **SNIP**




-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug