General discussion

  • Creator
    Topic
  • #2265721

    FTP Script

    Locked

    by ifisher ·

    I have an ftp batch script that I am using within a bat file. Is there anyway to capture/query the results of the ftp script. For instance, I would like to be able to tell if ftp error code 552 resulted during a file upload. I am capturing the ftp output but don’t know how to utilize within my bat file. For instance, can I somehow use the ‘find’ command to do this?

All Comments

  • Author
    Replies
    • #2579116

      The best way to deal with this

      by danlm ·

      In reply to FTP Script

      would actualy to code for errors within your script. here is how I did it in a shell script for a unix box

      [i]ftp -i -v -n http://ftp.droolin.org < $HOME/Unreal3.2/config/damnit.txt[/i]

      That was the ftp to a home server with all display output being directed to damnit.txt

      Here is the check against that file for an error.

      [i]grep ‘530 Login incorrect.’ $HOME/Unreal3.2/config/damnit.txt > $HOME/Unreal3.2/config/damnit1.txt
      if test -s $HOME/Unreal3.2/config/damnit1.txt
      then
      notify_email “Subject: Incorrect password was specified for $SERVERNAME. FTP update has aborted”
      fi[/i]

      Dan

Viewing 0 reply threads