How send a file from UNIX to Windows with FTP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How send a file from UNIX to Windows with FTP
# 1  
Old 08-28-2006
How send a file from UNIX to Windows with FTP

Hi
I'm new working in UNIX, So, I want to know How I can send a file from UNIX to Windows server with FTP. This is my script.

ftp -i -n -v <<**

open 199.99.99.99
user user1 password1
lcd C01_07_06 /* source/
cd //199.98.98.98/group1/reports /*destination*/
put file1.sh
bye

It's not working beacuse of cd command says destination is not a directory and the directory exists, the ping to 199.98.98.98 is working.

Thanks for your answers.
# 2  
Old 08-28-2006
Here is another way...this one is working fine since I am using it:

Code:
#! /usr/bin/ksh

HOST=ftp_server_ip
USER=your_login
PASSWD=your_password

exec 4>&1
ftp -nv >&4 2>&4 |&

print -p open $HOST
print -p user $USER $PASSWD
print -p cd /home/your_login
print -p binary
print -p put test.txt
print -p bye

wait
exit 0

Make sure you run the script where your file is or change directory first in your script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP XLSX file from UNIX to windows

Hi, Could someone suggest me how to FTP a xlsx file from unix to windows. I can able to transfer xls file from unix to windows successfully. But if i transfer the xlsx file im not able to open, it through error like "The file format or file extension is not valid" Thanks Rathna (4 Replies)
Discussion started by: Rathnakumar
4 Replies

2. Shell Programming and Scripting

How to send file from windows to UNIX daily?

Hi All! I am trying to write a little script that should go to a windows server get one file and put on a unix server, but I am not sure if it is the right way please help: #! /usr/bin/sh HOST=10.100.48.41 USER=ftp_hm PASSWD=P@$$w0rd ftp -n $HOST quote user $USER quote pass $PASSWD... (7 Replies)
Discussion started by: fretagi
7 Replies

3. Shell Programming and Scripting

ftp an excel file from windows to unix

Hi all.. Please help me on below requirement. I have an excel file ftped from windows to unix location. I am not able to open the file. if i am opening it in vi editor, i am getting only junk characters. I have to make the excel file as .csv file and read the data to put some business... (3 Replies)
Discussion started by: gani_85
3 Replies

4. 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

5. 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

6. Shell Programming and Scripting

file transfer from windows to unix using ftp

Hi all, I have a file in windows, example a.txt **** aaa bbb ccc <empty line> when i transfer this file to unix using ftp, and viewed the file # vi a.txt aaa bbb ccc # I dont get the empty line which i specified in that file in windows. Please help me, which in unix... (5 Replies)
Discussion started by: Nandagopal
5 Replies

7. Shell Programming and Scripting

ftp the latest file from unix to windows

Hi, I have a ftp script to ftp files from unix to windows. Now i need to pull the latest file from unix to windows. It is not working. ftp -nvi $SERVER > ${FILE_DIR}/NavigationftpLog << EOD user $USER $PWD lcd $FILE_DIR echo "the local directory is $FILE_DIR" cd $Remote_PATH echo... (2 Replies)
Discussion started by: ammu
2 Replies

8. UNIX for Dummies Questions & Answers

How to send a trigger file from Unix to Windows

I need to send a file from a Unix box to a Windows sever to kick off a Crystal Reports job. Any good ideas how to do this? Can it be done with FTP? (0 Replies)
Discussion started by: robw95
0 Replies

9. Shell Programming and Scripting

ftp file from Windows to Unix automatically

Hi, Is there a way to ftp file from windows to Unix directory by using crontab to set up a job ? Thanks! (4 Replies)
Discussion started by: whatisthis
4 Replies

10. UNIX for Dummies Questions & Answers

send file from UNIX to windows across network

Is there an easy way (besides samba) to send a file from a unix server to a win98 machine across a network. I am on a SCO server and need to send the file to a windows machine so the program on the machine does not keep on looking for it on my server. It checks for a new file every couple of... (5 Replies)
Discussion started by: umpi_97
5 Replies
Login or Register to Ask a Question