FTP file from win to UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP file from win to UNIX
# 1  
Old 06-11-2013
FTP file from win to UNIX

hi all,
i hv written the script for file transfer when i am trying to transfer the file on windows machine only same desktop from one location to another location that is working fine but when i am trying to transfer the same to unix server it is going in infinte loop and file is also not getting transfer. And i am not able define the variable also for transferring the file pls assist on the below code :-

Code:
setlocal enabledelayedexpansion
if exist C:\Ripudaman\VCB\FTP\*.txt (goto COPYFILES) else (goto NOFILES)

:COPYFILES
for /f %%i in ('DIR /b C:\Ripudaman\VCB\FTP\*.txt') do (
echo %%i
set fn=%%i
ftp
o 172.16.2.97
finacle
7018finacle
mput $i
bye
move %%i C:\Ripudaman\VCB\FTP\bkup\.
)

echo complete

:NOFILES
echo There are no files to move

any help will be appreciated.

---------- Post updated at 06:32 AM ---------- Previous update was at 04:06 AM ----------

m waiting for reply

Last edited by Franklin52; 06-11-2013 at 06:27 AM.. Reason: Please use code tags
# 2  
Old 06-11-2013
A reply, as requested:

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
# 3  
Old 06-11-2013
much clarification on the issue i am trying to transfer the file from windows to unix where mput is not working appropriately. i hv declare the variable i which is my files in the given directory and it is not transferring to unix system.
# 4  
Old 06-11-2013
ftp isn't going to "eat" the lines below it. To feed lines into ftp, you'll have to feed lines into ftp. Try writing them into a file first, then ftp < input.txt
# 5  
Old 06-11-2013
Code:
setlocal enabledelayedexpansion
if exist C:\Ripudaman\VCB\FTP\*.txt (goto COPYFILES) else (goto NOFILES)

:COPYFILES
for /f %%i in ('DIR /b C:\Ripudaman\VCB\FTP\*.txt') do (
echo %%i
set fn=%%i
ftp < open 172.16.2.97
ftp < finacle
ftp < 7018finacle
mput $i
bye
move %%i C:\Ripudaman\VCB\FTP\bkup\.
)

echo complete

:NOFILES
echo There are no files to move

this syntax is correct??
# 6  
Old 06-11-2013
No. You forgot the 'file' part of reading from file.

Running ftp 9 times to run 9 lines isn't going to work either. It won't be the same ftp command.

Code:
echo firstline > file.txt
echo secondline >> file.txt
echo thirdline >> file.txt
ftp < file.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

2. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

3. Windows & DOS: Issues & Discussions

RCP from Sco Unix to Win XP

Hello, Native XP rcp does not have a password prompt as far as I can see. I require a rcp.exe to copy a file from Sco to my XP pc. I did have this program that was part of pcnfs a few years ago. I need to run a scheduled batch job from a command line being. rcp.exe 192.168.5.33 -user root... (0 Replies)
Discussion started by: phil martin
0 Replies

4. HP-UX

S-FTP HP-UX to Bitvise (Win NT)

Trying to connect to an HP-UX machine using public key authentication - using User keypair manager to create a keypair - export the public key to a file - tried both OpenSSH and SSH2 - and then transfer the public key to the $HOME/.ssh/authorized_keys file on the Unix box - but when I try to... (0 Replies)
Discussion started by: cvanvak
0 Replies

5. UNIX for Dummies Questions & Answers

move from Win -> Unix

I'd like to become a web applications developer, and the company I currently work for use Sun/Apache and Perl, CGI and Python and Oracle to develop in (which is a little unfortunate for me as I have MS IIS and ASP/VBScript and SQL from my last job). I have an old laptop I'd like to convert from... (2 Replies)
Discussion started by: dawn
2 Replies

6. UNIX for Advanced & Expert Users

mount Win folder in UNIX ??

Hello, I like to mount an windows folder on my NT4 system in my UNIX system. How can i do that, i have installed SAMBA 2.2.7 on my Unix machine so i can access the UNIX machine from the NT . Do i need to install anything on the NT machine, or anymore software on the UNIX. I tried to do an... (5 Replies)
Discussion started by: sajjan2
5 Replies

7. Windows & DOS: Issues & Discussions

win,unix

hi, Could anyone tell me mounting windows directories in unix.I have used mount command in all directions like mounting hd00,hd1,hd2,hd3 and so on but that don't work for me Mohan (2 Replies)
Discussion started by: mohan
2 Replies

8. UNIX for Dummies Questions & Answers

Dummie Please Help With Unix And Win Xp

Please help : I have a question i am just starting to study UNIX and i need some advice,as my teacher isn,t the helpful type. I have just formatted my pc and partitioned it with win98 and winxp, do i need to create a partion for UNIX ??? OR is UNIX run in whatever partion i want it ???? Will... (6 Replies)
Discussion started by: DAFFYY30
6 Replies

9. Programming

ftp a file from remote pc of win 2000

Hello. I am programming in C on HP-UNIX system,i want ftp a file from remote pc which is window 2000 system,i donot how config my HP-UNIX and pc, i donot how program in C or in shell. Thank you for help. (3 Replies)
Discussion started by: bdyjm
3 Replies
Login or Register to Ask a Question