ftp-client w/o controlling tty

From: T. Horsnell (tsh) (tsh_at_mrc-lmb.cam.ac.uk)
Date: 01/17/05

  • Next message: David Nillesen: "DNS resolution fails over time"
    Date: Mon, 17 Jan 2005 16:50:31 +0000 (GMT)
    To: Managers <tru64-unix-managers@ornl.gov>
    
    

    Thanks to Lucio Chiappetti and Rob Leadbeater, I'm in business.

    Lucio pointed out that with the -n switch, I could do

    #ftp -n somehost < ftpcommandfile

    and thus not need the .netrc. This works from my httpd->cgi script.

    Rob Leadbeater also suggested the Perl Net::FTP, which I'll try later.
    This may be a neater solution that my bunch of perl system calls.

    Cheers,
    Terry.

    >Hi all,
    >I'm trying to make an ftp transfer from with a cgi script, and
    >want the ftp client to use my .netrc file. The cgi script is
    >run by an http daemon owned by me.
    >
    >If I run the test command:
    >
    >#perl -e 'system "ftp desthost"'
    >
    >everything works as expected, and the userid, passwd and ftp commands are
    >taken from .netrc. However when the command runs from within the cgi
    >script (under the control of the http daemon and hence no controlling tty),
    >the ftp command appears to try to run an interactive session, rather than
    >using the .netrc file, and of course fails.
    >
    >Any ideas how I can force it to use .netrc? Or alternative means of doing
    >the ftp? I've tried building the wu-ftp client but it moans about a lack
    >of termcap.h :( Has anyone built alternative ftp clients on Tru64?


  • Next message: David Nillesen: "DNS resolution fails over time"

    Relevant Pages

    • [HPADM] Re: RE: ftp script/batch job
      ... I don't normally reply to all on this list however since Kevin did I thought it was appropriate. ... While a .netrc file will do the job it is guaranteed to raise a audit flag. ... If you must script FTP consider, as a minimum, putting the FTP commands in a separate file in a ...
      (HP-UX-Admin)
    • openssh
      ... recognize a netrc file. ... Perhaps the code assumes something other than what MPE provides, a la ftp, although I have tried providing ".netrc" where it should live. ... SSH FTP also is unaware of MPE file types other than fixed ASCII and binary which really is sufficient for most transfers between non-like machines. ...
      (comp.sys.hp.mpe)
    • Re: Cant get automatic ftp working within system() method.
      ... Just as I only wrote 'ftp ftp.www.com' and had no .netrc file. ... It seams that the ftp command doesn't find the .netrc in $HOME. ... ps. -d option for ftp gives debug messages in linux, ...
      (comp.lang.c)
    • Re: .netrc for ftp to solaris 8
      ... > password at the ftp prompts and always get in. ... the .netrc stanza, since other stanzas with the same format work. ... Since you can log in to the Solaris FTP server manually, ... so it goes to the login prompt. ...
      (comp.unix.aix)
    • Re: .netrc between aix and solaris
      ... machine XXX.XXX.XXX.XXX login sunuser password sunpw ... When I run the ftp command to these servers at the pwd where .netrc is, ... this sun server. ...
      (comp.unix.solaris)