FTP file (Need help - urgent )

i am trying to login to FTP site and move the files. when i run the script on my local machine it completes the task in seconds but when it is run by the actual server it take 10 min to login to FTP... can anybody advice as to what might be the issue ???
i am trying to print current time in the expect.exp script which has command to login to FTP - no luck ... can anybody please advice how to do that ?

Is it seriously to just login and out from the server? Not performing any commands?

Sounds like some sort of DNS related issue, perhaps rather than attempting to ftp to the same machine you do from home, you could try localhost or 127.0.0.1.

After that I would look to Passive FTP issues.

Tough stuff to debug remotely without any logging. This is the basis of a simple perl script that would produce debugging to STDERR that could help debug ftp issues.


    use Net::FTP;

   my $ftp = Net::FTP->new("localhost", Debug => 1, Passive=>1)
      or die "Cannot connect to some.host.name: $@";

    $ftp->login("user","pass")
      or die "Cannot login ", $ftp->message;

    $ftp->cwd("/")
      or die "Cannot change working directory ", $ftp->message;

    $ftp->list()
      or die "list failed ", $ftp->message;

    $ftp->quit;

it is performing a set of commands...

how can i display time within Expect script.. i tried date, time, timestamp.. nothing worked