LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Very Strange FTP script problem ??? (https://www.linuxquestions.org/questions/linux-newbie-8/very-strange-ftp-script-problem-351183/)

lionking_x 08-08-2005 11:08 AM

Very Strange FTP script problem ???
 
Hi Folks,

I am trying to upload a file to a ftp server via cron. The script fails with the following error .

Server1 # ./ftprunner.orig
Connected to XYSW.YXTQ.
220-FTPTCPD1 IBM FTP CS V1R5 at XYSW.YXTQ, 11:55:32 on 2005-08-08.
220 Connection will close if idle for more than 5 minutes.
---> USER john
421 Service not available, remote server timed out. Connection closed
Login failed.
Not connected.
Not connected.

If i ftp manually , i can upload the server without any problems using the same userid and passwd. So it is not permissions.

Here is the script , (user is john, with passwd john123)
ftp -vnd XYSW.YXTQ <<-EOF
user john john123
put testfile testfile
quit
EOF

The same script works if i change the server name to another ftpserver. So the script is fine , no syntax problems.

Any clues guys ??? Thanks

spk

gazzamop 08-15-2005 04:53 AM

Rather strange indeed! It looks like a connection is made to the server (all good) and then that connection is "lost", hence no success. What happens if you execute this script at the command line? Could you post the line in your cronfile that runs the script? Make sure you don't have any newlines in the cronfile, as they are interpreted as being a new command - and remember that cron doesn't start with the same environment variables as you do.


All times are GMT -5. The time now is 09:29 PM.