File Transfer

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsscholar
Premium Member
Premium Member
Posts: 195
Joined: Thu Oct 19, 2006 2:45 pm

File Transfer

Post by dsscholar »

We transfer various source files on the unix server and a generic trigger file. This trigger file is used as an indication to start the load. The problem is that once a file is transferred along with a trigger file the job is kicked off and starts processing all the files that are present on the server. The problem occurs if another source file also starts getting transferred,it is also be picked up even if the transfer is not complete. Is there a way to check whether the file is completely transferred or not ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps you should rethink your idea of a generic trigger file. :P

There are various techniques. One it to check the incoming filesize at regular intervals and then process the file once it 'stops growing'. Not ideal, but I've seen it done. Another is to use a utility like fuser which purports to tell you if a file is 'in use' or not.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Two other approaches are:
1. copy the file to a temporary name. Once copy is complete change the name.
2. Create the file with no privileges to anyone but the writing process. Once copy is complete change the privileges to grant access.
Post Reply