Ftp issue

Hi we are facing an issue on our server
our job connects to a target server and pulls the file from a location .But it is taking too much time to do this .
Hwne i manully do the ftp it finished in few seconds
.but when the jobs is pulling it is taking 30 to 40 min .

please see the log below

2012-12-14 01:47:48 </foo/bar/baz/common/scr/com_wrapper_fsg.perl:(222)> INFO:blabla run command =
/foo/bar/baz/common/scr/aaaa_bbbbb_get_files.pl \
  /foo/bar/baz/common/FS_get_files com_wrapper_fsg.perl.tempfileC_ccccc.milrate_mm -z 20121213  \
 -a host1.mycompany.com -b host2.mycompany.com -t 3 -h 05 -k 07 -w no_wait
Host Name is hostname

Output is redirected to log file:

/foo/bar/baz/common/FS_get_files/LOG/com_wrapper_fsg.perl.tempfileC_ccccc.milrate_mm_20121213
ftp: setsockopt: Bad file descriptor
Trying to authenticate to <ftp@mycompany.com>
calling gss_init_sec_context
Trying to authenticate to <host@mycompany.com>
calling gss_init_sec_context
calling gss_init_sec_context
sealed (MIC) 53 bytes
secure_command(SYST)
encoding 72 bytes MIC YDMGCSqGSIb3EgECAgIBAAD/////N+GKBoSjGpdepaaM8jiTHyW1BZ6sVeBVU1lTVAADAwM=
sealed (MIC) 61 bytes
secure_command(USER noone)
encoding 84 bytes MIC YDsGCSqGSIb3EgECAgIBAAD/////I7fuDvJHBrIqMZGM7XeNIIENTC12rA0hVVNFUiBmaWRlaXRmAAMDAw==
sealed (MIC) 61 bytes
secure_command(PASS dummy)
encoding 84 bytes MIC YDsGCSqGSIb3EgECAgIBAAD/////BzfPI2/MGfN4KDOE2qgafBSTdHtxT8I4UEFTUyBkdW1teQAFBQUFBQ==
sealed (MIC) 53 bytes
secure_command(TYPE I)
encoding 72 bytes MIC YDMGCSqGSIb3EgECAgIBAAD/////Y681+N8s2i0vIul4n1GKqbhpSDsKA3unVFlQRSBJAAE=
ftp: setsockopt (ignored): Permission denied
sealed (MIC) 53 bytes
secure_command(PASV)
encoding 72 bytes MIC YDMGCSqGSIb3EgECAgIBAAD/////PhPbmg6Lf06hG8pBiKXpL1UCZZ8S9AdiUEFTVgADAwM=
sealed (MIC) 93 bytes
secure_command(RETR /bbbbbb/misc/ccccc/ccccc.milrate_mm)
encoding 124 bytes MIC YFsGCSqGSIb3EgECAgIBAAD/////Vi9s9ahsd2MqyZaJXbKyIrYQdFngJ6qaUkVUUiAvaWZlZWRzL21pc2MvZm9jYXMvZm9jYXMubWlscmF0ZV9tbQAHBwcHBwcH
sealed (MIC) 53 bytes
secure_command(QUIT)
encoding 72 bytes MIC YDMGCSqGSIb3EgECAgIBAAD/////QWH5iDFRI/T0rpJNG4DWkDjj7o4WX8OfUVVJVAADAwM=

so the process satrted at 1:47 AM and the time now is Fri Dec 14 02:21:07 EST 2012 . Why is this taking so long to pull afile of few kb's .

When i use ftp -d manually
see below output.

hostname% ftp -d host3
Connected to host3 (10.1.2.3).
220 host3 FTP server (Version 5.60) ready.
Name (host3:person): person
---> USER person
331 Password required for person.
Password:
---> PASS XXXX
230 User person logged in.
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.

Using binary mode to transfer files.please help

:frowning:

Are you running the perl script manually when you do a manual test?

It looks like the perl script is trying to use PASV mode for example. You did not in your example