SUMMARY: AUTOMATED FTP WITH TWO LOGINS

Christina.Allain_at_frx.com
Date: 06/09/04

  • Next message: Tis Unix: "shh - passwordless logins ......"
    To: Christina.Allain@frx.com, sunmanagers@sunmanagers.org
    Date: Wed, 9 Jun 2004 08:44:35 -0400 
    
    

    All,

    The script is now working, Michael DeSimone made the below suggestion:

    "The sleep 60 is a Unix command, which you know, but you are at an ftp

    prompt and that wont work. What you can do though is go to a shell to do

    the sleep. the only thing you would need to change is

    sleep 60

    to

    !sleep 60

    I added ! to the sleep and it work like a charm...

     

    For those interested the script look like this now:

    #!/bin/sh

    ftp -n rest.rest1.com << !EOF

    user test 13now

    !sleep 60

    user forest1 ttree

    cd /outbound

    hash

    prompt

    bin

     

    mget call_sample.txt

    mget call_detail.txt

    mget header.txt

     

    quit

    !EOF

     

    Thanks for all those that send me suggestions... I really appreciate all the
    efforts

    -----Original Message-----
    From: Allain, Christina
    Sent: Thursday, June 03, 2004 11:53 AM
    To: sunmanagers@sunmanagers.org
    Subject: AUTOMATED FTP WITH TWO LOGINS

    Hello Gurus,

     

      I am writing an automated script that needs to be place in cron job. The
    problem with the script is that, I need to log in twice. Does anyone have
    similar script? Suggestions are welcome. Thanks in Advance

     

     

     

     If I ran the ftp manually it looks like:

     

     

     

    ftp -n rest.rest1.com

    Connected to rest.rest1.com.

    220-FTP authentication :

    220

    ftp> user test 13now

    331-Password:

    331

    220 narnia FTP server (Version wu-2.6.2+Sun) ready.

    ftp> user forestl ttree

    331 Password required for forestl.

    230 User forestl logged in. Access restrictions apply.

    ftp>

     

     

     

    When I wrote the script with single user it works fine but with two logins
    it failed on the second login. Below is the script:

     

    #!/bin/sh

    ftp -n rest.rest1.com << !EOF

    user test 13now

    sleep 60

    user forest1 ttree

    cd /outbound

    hash

    prompt

    bin

     

    mget call_sample.txt

    mget call_detail.txt

    mget header.txt

     

     

     

    quit

    !EOF

     

     

    Below is the error from the script:

     

    # ./auto_ftp.scribe.ksh -v

    530 Login incorrect.

     

    Login failed.

    ?Invalid command

    Hash mark printing on (8192 bytes/hash mark).

    Interactive mode off.

    call_sample.txt: No such file or directory.

    can't find list of remote files, oops

    call_detail.txt: No such file or directory.

    can't find list of remote files, oops

    header.txt: No such file or directory.

    can't find list of remote files, oops

     

    ____________________________________________________________________
    This e-mail and its attachments may contain Forest Laboratories, Inc.
    proprietary information that is privileged, confidential or subject to
    copyright belonging to Forest Laboratories, Inc. This e-mail is intended
    solely for the use of the individual or entity to which it is addressed. If
    you are not the intended recipient of this e-mail, or the employee or agent
    responsible for delivering this e-mail to the intended recipient, you are
    hereby notified that any dissemination, distribution, copying or action
    taken in relation to the contents of and attachments to this e-mail is
    strictly prohibited and may be unlawful. If you have received this e-mail in
    error, please notify the sender immediately and permanently delete the
    original and any copy of this e-mail and any printout.
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers


  • Next message: Tis Unix: "shh - passwordless logins ......"

    Relevant Pages

    • AUTOMATED FTP WITH TWO LOGINS
      ... I am writing an automated script that needs to be place in cron job. ... If I ran the ftp manually it looks like: ... 230 User forestl logged in. ... can't find list of remote files, ...
      (SunManagers)
    • Re: FTP delete problem
      ... the problem was a lock to a file that the ftp get worked, ... Bernard Cheah ha scritto: ... generate by schedule task. ... If i manually execute the script, the output wrote, but by schedule ...
      (microsoft.public.inetserver.iis.ftp)
    • Re: FTP delete problem
      ... Yes, the script looking the previous day log file, but when it's still ... Bernard Cheah ha scritto: ... the problem was a lock to a file that the ftp get worked, ... generate by schedule task. ...
      (microsoft.public.inetserver.iis.ftp)
    • Re: Automate FTP account creation
      ... i.e when user register to website then an FTP account ... not give you root access. ... You could do it by executing a PHP script which switches to the root ...
      (comp.lang.php)
    • Re: Scripted FTP transfer
      ... Rather then specify the username and password in your script, ... going to run the ftp script, ... If you are running this from root, the .netrc will be created in / ... I'm trying to write a FTP command file on the fly to ...
      (comp.unix.sco.misc)