Check the file processed Completion

Hi,

I have a wierd requirement where i need to check for a file transfered to my Server and once it is completed i need to start processing my jobs.

My server is AIX 6.0 and i want to know is there some way in unix i can keep on checking the file and once it is completed successfully i can trigger my ETL jobs.

Thanks
Prasoon

How do you transfer the file to the location? Can't you use return value of the download script as executing trigger for processing of your jobs?

My source system is ftping the file to my server.

Do you have access to that source system? Can you modify that ftp script?

If that script is sending a file via ftp it should open an ftp connection. What about checking on state of that connection?

We get asked this question very, very frequently.

Bottom line, it's the sending thing's job to tell you when it's done, because the receiver can't tell the difference between a finished upload, a stalled upload, or an aborted upload -- all three will have a file sitting there unchanged for long periods of time.

One of the best ways for the uploader to inform you of a completed upload is:

  • Upload the file to /path/to/temporary/file
  • In the same FTP session, rename /path/to/temporary/file /path/to/destination/file

As long as /path/to/temporary/ and /path/to/destination/ are on the same partition, this guarantees that files always appear in /path/to/destination/ whole, never partial files or in-progress uploads.