ftp from unix to windows

How to do ftp from unix to windows

i have some files in a dir in unix box and i want to put those files in windows through FTP. How to do this ?

Windows does not normally run an FTP server, so you will probably need to 'get' the files using the Windows FTP client.

Otherwise you will need to configure IIS or some other FTP server under Windows.

or you may set samba on unix server ?

use dos prompt
go to start >run>cmd
then cd desktop
then ftp <server ip>>
username=ur login id on that server
>pwd=ur password of that server
then
>cd particular directory
then
>mget filename
>bye

FTPSERVER="YOUR_WINDOWS_IP"
FTPLOGIN="YOUR_WINDOWS_USERNAME"
FTPPASS="YOUR_WIN_PASSWORD"
FTPDIR="YOUR_DEST_DIR"
FILE="FILENAME_TO_FTP"

ftp -n -i $FTPSERVER <<EOF
user $FTPLOGIN $FTPPASS
cd $FTPDIR
put $FILE
quit
EOF

instead of put you can use the mput for multiple files.

i did it like this but it getting stuck

FTPSERVER="100.48.143.13"
FTPLOGIN="nali"
FTPPASS="sun1123"
FTPDIR="class"
FILE="file1.txt"

ftp -n -i $FTPSERVER <<EOF
user $FTPLOGIN $FTPPASS
cd $FTPDIR
put $FILE
quit
EOF

--------------------------------------------------------------------------

what to do

################# FTP #############################

USER_LOG='/u01/UAT/scripts/scriptslog/in_ftp_pushing.log'
`touch $USER_LOG`
REMOTESERVER=97.253.17.142 # Your Remote IP
REMOTEPATH='/u01/app/ITOPS' # Give the Full path
LOGIN='it_dwh' # Your Login Name
PASSWORD='it_dwh' # Your Login Pwd
cd $LOCALDIR
ftp -n $REMOTESERVER << INPUT_END
quote USER $LOGIN
quote PASS $PASSWORD
hash
bin
cd $REMOTEPATH
prompt off
mput *.osa.gz # Add your file1.txt
bye
INPUT_END
if [ $? -ne 0 ]
then
echo "Error in the FTP file moving. on `date` " >> $USER_LOG
echo "The OUT_STATUS is: $?" >> $USER_LOG
else
echo "The FTP file is moved successfully.." >> $USER_LOG
echo "The OUT_STATUS is: $?" >> $USER_LOG
fi
################################################

Regards
Mr.Hanuma

i m writing this script in k shell. do i have to modify anything in the upper script which is bash

That looks fine to me. Is there no output at all? If there is some output, where exactly does it get stuck?

This is really very simple, i am also using it for the same purpose.

i am using the below script to ftp windows machine and i have configured IIS for
FTP server.

KarachiOMP root> vi newcho
#!/bin/sh
WINDOWS_SERVER=172.17.1.22
LOCALDIR=/omp/omp-data/logs/5erm

CurrentDate=`TZ="GMT+24" date +'%y%m%d'`

#CurrentDate=`date +%y%m%d`
#FILENAME=080901.APX

# transfer the file
ftp -in << EOF
open $WINDOWS_SERVER
user waqas 123
ascii
lcd $LOCALDIR
cd /5ERM
put $CurrentDate.APX
cd ..
lcd /omp/omp-data/logs/rcvlog
cd /RCVLOG
put $CurrentDate.RCV.Z
cd ..
lcd /omp/omp-data/logs/ecprop
cd /ECPROP
put $CurrentDate.APX
cd ..
lcd /omp/omp-data/logs/OMPROP1
cd /omp

put $CurrentDate.APX

close
EOF