Computing.Net > Forums > Unix > UNIX Shell FTP script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

UNIX Shell FTP script

Reply to Message Icon

Name: Guy Raymond
Date: September 5, 2002 at 10:26:23 Pacific
OS: SunOS
CPU/Ram: N/A
Comment:

Hi,

I've managed to create a C Shell script to get the names of the ASCII files that I want to FTP off of my remote hosts. The names of the ASCII files that I need to download from my remote hosts are in a text file as follows:

wilson.ascii
charlotte.ascii
jersey.ascii
atlanta.ascii

What I want to do is have a cron job run every week to FTP the appropriate ASCII files from my remote hosts to a central host (where this text file containing the ASCII file names is located). Each of the ASCII files listed in the text file are on different hosts. With the script I want to FTP to each remote host, CD to the proper directory where the ASCII file is located and FTP it back to my central server. I want this process to be automated. The HOST name for each remote host is the name contained in the text file (minus the [.ascii] e.g. wilson, charlotte, jersey, etc...) which should make things a little easier for the automated script. I just can't figure out how to get started.

Any suggestions are greatly appreciated. Thanks!

Guy



Sponsored Link
Ads by Google

Response Number 1
Name: tom z.
Date: September 6, 2002 at 03:24:58 Pacific
Reply:

Hmmm, the only issue is providing the password to the ftp host, how would you deal with that? I know that most systems will not allow passwords in the clear in a script on the system, security issues.

Good luck, just something else to consider, before you get too automated.


0

Response Number 2
Name: David Perry
Date: September 6, 2002 at 04:10:43 Pacific
Reply:

#!/bin/sh
for host in wilson charlotte jersey atlanta ; do
ftp -n -i $host < user username password
cd /path/name
get $host.ascii
close
quit
!!
done


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: UNIX Shell FTP script

Unix Shell Script www.computing.net/answers/unix/unix-shell-script/3580.html

unix shell script www.computing.net/answers/unix/unix-shell-script/5343.html

Unix shell script runing SQL files www.computing.net/answers/unix/unix-shell-script-runing-sql-files/5286.html