Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.asciiWhat 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

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.

#!/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

![]() |
![]() |
![]() |

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