I have a program that is started by a user at anytime during the work day. That program once started creates a file and continues to write to that file until its done. I have a script that runs every 5 minutes looking for this file and ftps it to another server. The problem is that sometimes this program takes a long time (15-30 minutes) to complete and the file (since the program initally creates it) is ftped over even though the program is still writing to it and the user has an incomplete file. Is there a way to tell when the file is complete before the ftp process works. So basically it would be if file is being written to do not ftp over. If that is not possibel I though of comparing the last modification time of the file to the system time and if the modification time is older than 30 minutes then ftp the file if not do nothing. In both possible solutions I would need assitance on how to write it.
I am running Solaris 10 06/06