FTP in Shell Script

Drew_Rohde at kcmo.org Drew_Rohde at kcmo.org
Tue Jul 25 15:40:43 CDT 2000


I'm writing a shell script (korn) to find any files in a directory tree
that are new or changed and ftp them to another system in the same
directory structure.  I have been successful finding the files with -newer
comparing to a time stamp file that I touch every time the script runs, but
am getting stumped on automating the login for the ftp.
I chose shell over perl because I thought it would be easier to learn,
since I haven't done either very much.
I remember reading (at some time many brain cells ago) about macros for
ftp, but there were security concerns, and this will be ftping through a
firewall.  Since I need to get this done this afternoon, I just need
something simple that will work for the short term.  Then I will look into
doing it more securely with more bells and whistles, like making sure the
parent directory exists first and creating it if not, and replicating
deletions to the destination.  Current assumption is that the parent
directories exist and we don't care about deletions.

Any suggestions would be greatly appreciated.
Drew




More information about the Kclug mailing list