FTP using script not working (for transfering file from a remote unix server to windows PC.)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP using script not working (for transfering file from a remote unix server to windows PC.)
# 1  
Old 07-09-2012
FTP using script not working (for transfering file from a remote unix server to windows PC.)

hi,
Im using the following code for FTP
Code:
#!/usr/bin/ksh
ftp -v -n "10.29.45.11" << cmd
user "mahesva" "mahesva123"
get rtl.tar
quit
cmd

Below is the log when i run the above code
**********************************
Code:
Connected to 10.29.45.11.
220 (vsFTPd 2.0.1)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
331 Please specify the password.
230 Login successful.
local: rtl.tar remote: rtl.tar
227 Entering Passive Mode (10,29,45,11,210,37)
150 Opening BINARY mode data connection for rtl.tar (45502 bytes).
WARNING! 196 bare linefeeds received in ASCII mode
File may not have transferred correctly.
226 File send OK.
45502 bytes received in 0.046 seconds (9.7e+02 Kbytes/s)
221 Goodbye.

***************************************************


but when i look in C drive of my PC ...rtl.tar is not there..why the tarnsfre is not success.
But log is showing file is sent...

Last edited by Franklin52; 07-11-2012 at 05:00 PM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 07-09-2012
You can just google or search in the forum on "Automating FTP" / "Automate FTP".

There are tonnes of discussions on this topic Smilie
This User Gave Thanks to PikK45 For This Post:
# 3  
Old 07-09-2012
hi PKK45,
i have taken this script from this forum... eventhough its showing that file is sent,im not able to find tht in my c drive of windows..
Please help me troubleshoot..
# 4  
Old 07-09-2012
May be you have issues here:

Code:
 #!/usr/bin/ksh
ftp -v -n "10.29.45.11" << cmd
user "mahesva" "mahesva123"
get rtl.tar
quit
cmd

Rather try using this, when FTPing from UNIX to Windows
Code:
 #!/usr/bin/ksh
ftp -v -n "10.29.45.11" << cmd
quote USER $USER
quote PASS $PASS
get rtl.tar
quit
cmd

I have a script and it works fine Smilie
This User Gave Thanks to PikK45 For This Post:
# 5  
Old 07-09-2012
hi PKK,
i have used ur script as below,
mahesva and mahesva123 are username and password for this VNC server
Code:
#!/usr/bin/ksh
ftp -v -n "10.29.45.11" << cmd
USER "mahesva"
PASS "mahesva123"
get rtl.tar
quit
cmd


but im getting a error

+++++++++++++++++++++++++++++++++
Code:
Connected to 10.29.45.11.
220 (vsFTPd 2.0.1)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
?Invalid command
?Invalid command
local: rtl.tar remote: rtl.tar
530 Please login with USER and PASS.
Passive mode refused. Turning off passive mode.
530 Please login with USER and PASS.
ftp: bind: Address already in use
221 Goodbye.

+++++++++++++++++++++++++
please help ,as im a beginner in this.


Quote:
Originally Posted by PikK45
May be you have issues here:

Code:
 #!/usr/bin/ksh
ftp -v -n "10.29.45.11" << cmd
user "mahesva" "mahesva123"
get rtl.tar
quit
cmd

Rather try using this, when FTPing from UNIX to Windows
Code:
 #!/usr/bin/ksh
ftp -v -n "10.29.45.11" << cmd
quote USER $USER
quote PASS $PASS
get rtl.tar
quit
cmd

I have a script and it works fine Smilie

Last edited by Franklin52; 07-11-2012 at 05:01 PM.. Reason: Code tags
# 6  
Old 07-09-2012
@dll_fgpa

did you use
Code:
 USER "mahesva"
PASS "mahesva123"

or
Code:
quote USER "mahesva"
quote PASS "mahesva123"

I think the second case will work as expected!
This User Gave Thanks to PikK45 For This Post:
# 7  
Old 07-09-2012
hi pkk,
thank u...im using the second case..
below is the log file..,im getting ...But transfer is not succes...still im not able to get the file in windows.
++++++++++++++++++++++
Code:
Connected to 10.29.45.11.
220 (vsFTPd 2.0.1)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
331 Please specify the password.
230 Login successful.
local: rtl.tar remote: rtl.tar
227 Entering Passive Mode (10,29,45,11,226,226)
150 Opening BINARY mode data connection for rtl.tar (45502 bytes).
WARNING! 196 bare linefeeds received in ASCII mode
File may not have transferred correctly.
226 File send OK.
45502 bytes received in 0.046 seconds (9.6e+02 Kbytes/s)
221 Goodbye.

++++++++++++++++++++++++++
please help

Last edited by Franklin52; 07-11-2012 at 05:01 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

2. Shell Programming and Scripting

Need help for ftp a file from unix to windows server

I have a problem with ftp. i want to ftp a file "file.txt" from unix box to windows server. The destination folder is something like this: "\\windowsservername\apps\is\" FTPUSER=ftp1 FTPPASS=**** ftp -v -d -n > ftplog <<!EOF open windowsservername user $FTPUSER $FTPASS cd... (3 Replies)
Discussion started by: Diddy
3 Replies

3. Shell Programming and Scripting

UNIX script to FTP file from UNIX server to windows

Hi, I am new to this subject.....Can someone please help me out with the script... unix usernm "sdhftst" unix pwd "chsd13" windows usernm "dfghtst" windows pwd "chsd13" path..../xxx/xxxxx/xxxxxx/xxxxxxx please can u get me a script...its only one file to get ftp. Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies

4. Shell Programming and Scripting

shell script to ftp the files from windows to unix server

Hi, I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine. Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the... (10 Replies)
Discussion started by: kavithakuttyk
10 Replies

5. Linux

vsftp is not working only when i ftp from windows server

Hello Gurus, Naif is implemented for only for port 21 for few windows servers. I have made my linux 5.1 as my FTP server. After installing vsftpd i could ftp from other linux server. linux to linux (ftp server) But same when i ftp from other windows server which only port 21 is enabled.... (2 Replies)
Discussion started by: bullz26
2 Replies

6. Solaris

vsftp is not working only when i ftp from windows server

Hello Gurus, Naif is implemented for only for port 21 for few windows servers. I have made my linux 5.1 as my FTP server. After installing vsftpd i could ftp from other linux server. linux to linux (ftp server) But same when i ftp from other windows server which only port 21 is enabled.... (0 Replies)
Discussion started by: bullz26
0 Replies

7. UNIX for Dummies Questions & Answers

Remote Access to FTP server not working

I am trying to setup an FTP server in a Fedora Core 3 machine through the command line interface and not KDE. I think I am successful in getting the ftp service running, as when I do an ftp 127.0.0.1, I am able to log in using any one the user accounts I have created on this machine and browse... (8 Replies)
Discussion started by: cooljumbo2k8
8 Replies

8. IP Networking

Transfering file from unix server to a windows pc

Is there a way to transfer files from unix server to windows directory,other than ftp? (1 Reply)
Discussion started by: Preet
1 Replies
Login or Register to Ask a Question