The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-01-2008
bsandeep_80 bsandeep_80 is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 122
FTP - shell script question

Hi All,

I had a question on something which i have trying to add to my current shell script which does FTP of files from my local machine to a remote server.

I have 5 files which i zip and FTP them on daily basis to a remote server. My script is as below:
############################
#!/bin/sh
temp="put $1"
ftp xxxx.this is IP address of remote machine.com << EOFFile
myusername
binary
$temp
quit
EOFFile
exit 0
############################

I am successfull in doing this activity.

But sometimes there is some problem with the remote FTP machine the FTP fails.

My problem is that i am only able to determine this failure after manually logging in checking for the files on remote machine.

My remote files look like this on FTP machine, all the files have the same name each day and The system date of this matches with the local machine:

08-31-08 10:00PM 55182 help1.zip
08-31-08 10:00PM 64861 help2.zip
08-31-08 10:00PM 57915 help3.zip
08-31-08 10:01PM 224245 help4.zip
08-31-08 10:01PM 2388 help5.zip


Is there a way i can add in my script or have an external script that checks for these files on FTP machine( probablly compare with local machine date stamp and FTP date stamp to determine the latest files are there).

Please suggest

Thanks,
Sandy