UNIX FTP script help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting UNIX FTP script help
# 1  
Old 11-08-2016
UNIX FTP script help

How do we write a simple FTP script where we write all the commands like open, user, pwd, get, etc written to a command file and then executing the command file with FTP utility? Thank you.

Kumar
# 2  
Old 11-08-2016
Did you search the forum? there are really a lot of threads about ftp scripting
like
e.g.
FTP script to get latest file from server
# 3  
Old 11-08-2016
Quote:
Originally Posted by vskr72
How do we write a simple FTP script where we write all the commands like open, user, pwd, get, etc written to a command file and then executing the command file with FTP utility?
They go in a file named .netrc in your current directory. You still need to specify the host on the command line.
# 4  
Old 02-24-2017
AP Tempe FTP notes using a Linux system
We are just using a .netrc file to connect to the server and a put command to place the files there.


Code:
ftp xxx.xx.x.xx
Connected to xxx.xx.x.xx (xxx.xx.x.xx).
220 FTP Server ready.
331 Password required for aptempe.
230 User aptempe logged in.
Remote system type is UNIX.
ftp> ls
227 Entering Passive Mode (xxx,xx,x,xx,215,131)
ftp: connect: Connection timed out

And here's where it hangs....


Moderator's Comments:
Mod Comment
Please wrap all code, files, input & output/errors in CODE tags.
It makes it far easier to read and preserves multiple spaces for indenting or fixed width data.

Last edited by rbatte1; 02-27-2017 at 08:31 AM.. Reason: Added CODE tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 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

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

3. Shell Programming and Scripting

Help on FTP download using UNIX script

Hi guys, I'm new on this forum and on UNIX. Can somebody help in writing a script to download a file from an FTP server and validating if there is a file to download. If there is a file, I would send it to a mail recipient and if not I would generate an error log. Thanks in advance!:D (1 Reply)
Discussion started by: rjay_45
1 Replies

4. Shell Programming and Scripting

Unix script (sh): state of ftp process

Hi guys, I'm writing a script in which I have to get file from a remote host by ftp. The problem is that the remote machine could be very slow, not connected or ok. To resolve this problem, I write this: echo "verbose on" > ftprap.cmd echo "prompt " >> ftprap.cmd echo "ascii"... (3 Replies)
Discussion started by: egiz81
3 Replies

5. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

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

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

8. Shell Programming and Scripting

FTP on Reliant UNIX - script problem

Hello... I have script that works perfect on solaris but on Reliant UNIX sometimes it does not work ...I send files to my Xp(from Reliant UNIX) but if I try to send it to my solaris machine file can not be send... script is: #!/bin/ksh localFile=$1 remoteFile=$2 ... (0 Replies)
Discussion started by: amon
0 Replies

9. UNIX for Dummies Questions & Answers

FTP within a UNIX script

I'm writing a script to untar/unzip a TAR file. Once this is complete, I would like to FTP one of the files to another server. I'm looking for an example on how this might be coded. So for example .... File name = checks.xml The server name = mmarsh ( 10.20.10.20) server id = mmid... (2 Replies)
Discussion started by: mmarsh
2 Replies

10. Shell Programming and Scripting

FTP script in Unix shell script

Hello , I am trying to make a shell script (Unix) for a ftp connection to another server and to get a file. So I have no knowledge about ftp and my script must do automaticly the connection with the user and passwd. Can you help us about that... Christian... (2 Replies)
Discussion started by: steiner
2 Replies
Login or Register to Ask a Question