Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I have a script which connects to the FTP server and downloads few files from the server. I had a problem in executing the script when the FTP Server ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    1

    FTP server existence Check

    Hi,

    I have a script which connects to the FTP server and downloads few files from the server.

    I had a problem in executing the script when the FTP Server was not active. The script tried to connect to the FTP Server but it didnt and the main thing was that it didnt even proceed further. It got stuck at FTP prompt.

    I want to know how do we check before doing any work, existence of FTP Server. Please tell me how to check for it without the script hanging.

    Thanks in advance.

    Regards,
    Jay

  2. #2
    Linux Newbie
    Join Date
    Feb 2008
    Location
    Bangalore, India
    Posts
    112
    Run nmap portscanner on remote host from you localhost, which is not recommended though.

    Code:
    nmap  remote host ip/name
    Output will be something like this, grep for port 21/ftp and based on that manage your script.

    Code:
    nmap remote-host-ip/name
    Starting Nmap 4.53 ( http://insecure.org ) at 2008-07-31 19:24 IST
    Interesting ports on   remote-host-ip/name (10.10.10.10):
    Not shown: 1708 closed ports
    PORT     STATE SERVICE
    22/tcp   open  ssh
    80/tcp   open  http
    993/tcp  open  imaps
    3306/tcp open  mysql
    till the time let me think of some other way.

    - nilesh
    bigunix.blogspot.com
    Registered Linux User: #476440

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...