#!/bin/csh -bf # # ftp.retrieve # # Usage: ftp.retrieve CommandFile RemoteHost # # 95/08/04 W. Prescott # # Procedure opens an ftp session to RemoteHost # and executes the commands in CommandFile # # Modifications; # 1998/04/28 whp Commented out retry. It didn't make any # sense and could not have been working # since $time was not defined. # Process command line # -------------------- if ($#argv < 2) then echo " " echo "ftp.retrieve" echo "Usage: ftp.retrieve CommandFile RemoteHost" echo " " exit 1 endif set CommandFile = $argv[1] set RemoteHost = $argv[2] set LogFile = $CommandFile.log set ErrFile = $CommandFile.err #echo $CommandFile #echo $RemoteHost #echo $LogFile # Start ftp section # Note: Username (anonymous) and password (jsvarc@usgs.gov) # taken from .netrc file in user's home directory. # ------------------------------------------------------- echo "Trying to reach $RemoteHost at time:" > $LogFile date +'%H:%M hrs; %d %h %y' >> $LogFile (ftp $RemoteHost < $CommandFile >> $LogFile) >& $ErrFile exit