Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Answers to Frequently Asked Questions Automate FTP / Scripting FTP Transfers Post 51467 by Perderabo on Thursday 20th of May 2004 08:50:27 PM
Old 05-20-2004
Automate FTP / Scripting FTP Transfers

One of our most frequent questions is how to automate ftp transfers. There are several approaches. Since I'm writing this post, we will start with my favorite technique. Smilie

In Automated FTP task I present a simple example of my ksh co-process technique. And note that later in this thread I explain how it works. And in For Loops Within Ftp Comands I show how to use the co-process technique in conjunction with a loop.

In Automated FTP we see an example of another technique called a "here document".

And in Telnet and file Copy/Delete Problem we see and example of the .netrc technique.

There are dozens of more threads, but they are all using one of the techniques above (or a combination of techniques 2 and 3). You can find them with our search function.

For a perl solution, see Perl scirpt for automatic file transfer.

connecting to Unix from windows - help has this link which may help if you need to have an ftp script on a box running Windows.

And then, there is this.

sftp is different program that uses a different protocol and has different requirements. sftp scripting recommends this site. Also see automate sftp using unix script.

Last edited by Perderabo; 05-21-2005 at 03:17 PM..
This User Gave Thanks to Perderabo For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

automate an ftp job

Hi, I am trying to write and automate a ftp job that connects to a IBM mainframe and pulls the same files everyday. To do this I assumen I create a .netrc file in my solaris home directory, then I write a shell script. How do I envoke ftp from a ksh script and pass it the info in .netrc? I... (11 Replies)
Discussion started by: flowrats
11 Replies

2. UNIX for Advanced & Expert Users

Automate FTP

Hi all, I got this piece of code in this forum and I can't seem to get it work. The thread already closed so I just post a new thread. #!/usr/bin/ksh ftp -v -n "YOUR.IP.ADD.RESS" << cmd user "user" "passwd" cd /distant/directory lcd /local/directoryget ssh_install get ( or put) your... (4 Replies)
Discussion started by: CamTu
4 Replies

3. Shell Programming and Scripting

How to automate an FTP process?

Hello script experts, I am newbie to shell script. But I have to write a shell script (ASAP) where I need to ftp a file on daily basis to a remote server, and send an email with final status. I I should have a properties file with hostname, Userid, and pwd. And a shall script file should read... (1 Reply)
Discussion started by: ksak
1 Replies

4. UNIX for Dummies Questions & Answers

History of old FTP transfers

How can one find the name and size of files ftp'ed during an old ftp transfer. Is there any log where these details are stored or any UNIX command which can provide these details. Thanks in advance. (4 Replies)
Discussion started by: Nakul Mukerjee
4 Replies

5. Shell Programming and Scripting

Automate FTP

Hi, Currently, i am using sftp manully to transfer files between two secure servers. Can anyone provide me a sample shell script which can automate the sftp process? (11 Replies)
Discussion started by: borncrazy
11 Replies

6. Shell Programming and Scripting

Automate daily FTP files

How to automate FTP files daily with the following constraints 1) Try (every 15 mins or 30 mins) FTP till it reconnects 2) Files that arrive in between 5:30 pm and 2:00 am 3) The sat and sun, mon files are to be FTP on monday. 4) Only the txt files are to be FTP'ed. The following are the... (2 Replies)
Discussion started by: bobbygsk
2 Replies

7. Shell Programming and Scripting

How to automate ftp in perl

My situations is I cannot use NET::ftp. So I need to have a way to automate ftp. I know how to do it in ksh: #!/usr/bin/ksh ftp -i -v -n $host_name <<_FTP >> $log_file 2>&1 user $user_name lcd $local_dir cd $remote_dir put $file_name bye _FTP But how can I do it in perl? Note:... (6 Replies)
Discussion started by: egyfan
6 Replies

8. IP Networking

Slow LAN FTP Transfers with FreeBSD...

Hello, I've got a FreeBSD 6 server running on my network that I used as a file server for my main computer. However I've really become frustrated with the slow up/down speeds I'm getting, about 100KB/s, which is about as bad as if I was using a "real" server. My setup is as follows: ISP |... (4 Replies)
Discussion started by: CyberCat
4 Replies

9. UNIX for Advanced & Expert Users

TO Automate the FTP process

Plzz Some One Help in this matter I have scripts to load the data into tables and to copy files from ftp to our system. we use to run the scripts every day.... we hav the files in the FTP server and we hav to bring the files to our system and we hav to load the data into the tables. We... (0 Replies)
Discussion started by: nani1984
0 Replies

10. Shell Programming and Scripting

Automate [ls]ftp

Heyas Seen some of the ftp posts here and knowing i'll be writing a script using ftp soon, so i thought i'd write a script to automate, or at least simplify some basic tasks with it. I'm currently stuck at handling active/passiv modes. Neither lftp nor sftp seem to support them by arguments,... (3 Replies)
Discussion started by: sea
3 Replies
ftpconfig(1M)						  System Administration Commands					     ftpconfig(1M)

NAME
ftpconfig - set up anonymous FTP SYNOPSIS
ftpconfig [ftpdir] ftpconfig -d ftpdir DESCRIPTION
The ftpconfig script is executed by the super user to set up anonymous FTP. Anonymous FTP allows users to remotely log on to the FTP server by specifying the user name ftp or anonymous and the user's email address as password. The anonymous users are logged on to the FTP Server and given access to a restricted file area with its own file system root. See chroot(2). The FTP area has its own minimal system files. This command will copy and set up all the components needed to operate an anonymous FTP server, including creating the ftp user account, creating device nodes, copying /usr/lib files, and copying timezone data. The passwd and group files set up have been stripped down to prevent malicious users from finding login names on the server. The anonymous file area will be placed under ftpdir. If the ftp user account already exists, then the current FTP area is used, and the system files in it are updated. All other files are left untouched. This command should be run to update the anonymous FTP area's configuration whenever a system patch is installed, or the system is upgraded. OPTIONS
-d Create a new or update an existing ftpdir without creating or updating the ftp user account. Use this option when creating guest FTP user accounts. OPERANDS
The following operands are supported: ftpdir The absolute pathname of the directory under which the anonymous FTP area is set up. EXIT STATUS
The following exit values are returned: 0 Successful completion 1 Improper usage of the command 2 Command failed ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWftpu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ftpaddhost(1M), in.ftpd(1M), useradd(1M), chroot(2), attributes(5) SunOS 5.10 1 May 2003 ftpconfig(1M)
All times are GMT -4. The time now is 06:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy