Issue with ftp (Windows NT) via SHELL SCRIPT to get files.
Hi Everyone,
I have an issue with shell script #! /usr/bin/ksh HOST=myhost USER=myuser PASSWD=myuser ftp -nv <<EOF open $HOST user $USER $PASSWD bye EOF when i run this shell to test connection from unix machine to unix ftp it works fine. but when the target ftp server is Windows NT it gives the following error [test@testserver test]$ sh test.sh Connected to SERVER. 220 Microsoft FTP Service 500 'AUTH GSSAPI': command not understood 500 'AUTH KERBEROS_V4': command not understood KERBEROS_V4 rejected as an authentication type 331 Password required for myuser. 530 User myuser cannot log in. Login failed. 221 Please let me know is there any problem with the script/server. Thanks Meenakshi |
when i tried to connect thru shell prompt its connecting.
but thru shellscript no luck please help me. |
Quote:
There is no problem with your script, but there appears to be a problem with the Windows FTP server. Start there. Look at the Windows FTP logs. Pay particilar attention to the very obvious errors you're getting: Quote:
|
Quote:
Hello Thanks for the reply i din bump the thread unecessarily i just tried ftp command thru shell prompt and it got connected so jus thought it would be helpful for anaysing the problem. by the way EXPECT din work for me. Thanks Again |
Quote:
Which shell are you using at the command prompt? How did you create the script -- was it a Windows editor? What happens if you run the script by sh yourscript.sh? |
Quote:
Connected to XX-XX-proxy2.XX.XXX.XXX. 220 Microsoft FTP Service 500 'AUTH GSSAPI': command not understood 500 'AUTH KERBEROS_V4': command not understood KERBEROS_V4 rejected as an authentication type Name (XX.XX.XXX.com:test): myuser 331 Password required for myuser. Password: 230-Welcome to XX.XX.XXX.com FTP 230 User myuser logged in. Remote system type is Windows_NT. ftp> bye this is the output i get. its bin/bash. i had created the script thru windows text editor but i used dos2unix command before i ran this script. Thanx a lot for the reply |
OK -- that's doing it manually. What about running the script and running the script by the sh command?
|
Quote:
[test@testserver]$ sh test.sh Connected to XX-XX-proxy2.XX.XXX.XXX. 220 Microsoft FTP Service 500 'AUTH GSSAPI': command not understood 500 'AUTH KERBEROS_V4': command not understood KERBEROS_V4 rejected as an authentication type 331 Password required for myuser. 530 User myuser cannot log in. Login failed. 221 im not running the script thru any cron tab just im calling it in another shell script.but for testing i wrote it seperately in test.sh. |
The purpose of the sh was to stop the #!/bin/ksh being actioned. It appears that the same commands work at the command prompt but not when run in a script so I'm trying to find the significant difference. One difference between running the script and entering the same commands at the command prompt is that the script is run using ksh (any specific reason for that? You could try using #!/bin/bash).
Another possibility was (or is -- the dos2unix command may not have been effective ...?) that the commands are not the same. You could try the od command to see exactly what is in the file, like this: Code:
c@CW8:/tmp$ od -c test.sh |
I tried with bash also and i created new file in vi editior n executed but still the problem exists.
Mean while the same script i tested in 2 other unix to windows FTP server there it works fine. I guess there is some problem with the ftp server firewall settings. Anyways, Thanks for the replies. It helped me to debug the issue. |
Quote:
|
All times are GMT -5. The time now is 09:21 PM. |