Rocket U2 | UniVerse & UniData

 View Only

 Universe File COPY

Sandy Barry's profile image
Sandy Barry posted 01-13-2021 10:23
Does anyone know an easy way to tell if a large file copy is complete?  we have many programs creating/copying files to Type 19 directories and we also have a main program scanning these directories to ftp files to Windows servers to make them available for users.  We need to make sure the main scan program does not pick up a file until the copy is complete.
We are on Linux, Universe 11.1.3.
John Green's profile image
PARTNER John Green
The traditional method is to have the process that is doing the copy output a trigger file when the copy is complete. Your main scan program looks for the trigger file. When it sees the trigger file it knows the main file copy is complete.
Sandy Barry's profile image
Sandy Barry
how issue is that we have hundreds of programs that do the copy so we do not want to have to change every program if possible.
Mike Rajkowski's profile image
ROCKETEER Mike Rajkowski
Sandy,

Can you easily change the copy routine/method?

If so, put the file in another (temp/work) directory on the same filesystem, then when the copy is completed move to the final location.
Mike Bojaczko's profile image
Mike Bojaczko
Sandy,

Did you find a solution? I'd like to know how it worked out if you don't mind.
Jeff Teter's profile image
Jeff Teter
Another simple solution would be to copy the file to a working name and then rename to the correct name after the copy has completed. For instance, copy 'fred' to '_fred'. Then rename '_fred' to 'fred' after the copy has completed. If these are done in series, the copy will be completed before the rename is done.