Rocket U2 | UniVerse & UniData

 View Only
  • 1.  Universe File COPY

    Posted 01-14-2021 09:00

    Have the monitoring program use the unix 'fuser' command on each file it checks.  If the command returns a PID, then another process (the copying process) still has the file open.

     

    We use the '-o' option, but we're running AIX so options might be a little different on Linux.

     

    Brian Paige

     



  • 2.  RE: Universe File COPY

    Posted 01-15-2021 09:09
    Thanks I will try that.

    ------------------------------
    Sandy Barry
    ARAMARK
    ------------------------------



  • 3.  RE: Universe File COPY

    Posted 01-19-2021 10:46

    Also – and my apologies for not thinking about this until now, but have you looked into using Samba shares?  That would eliminate the need for the monitoring/copying process.

     

    Brian Paige

     






  • 4.  RE: Universe File COPY

    Posted 01-19-2021 11:04
    If you are running the copy from a basic program you can use the LOCK feature and UNLOCK.
    Example
       LOCK 1 THEN
          *** YOU CODE TO COPY THE FILE 
          UNLOCK 1
       END

    The LIST.LOCKS command from TCL will show that LOCK 1 is set and once the copy is done then it removed the lock. If the lock is already set then it will do nothing.


    ------------------------------
    Kathleene Hunter
    Consultant
    Resolution Provider LLC
    ------------------------------



  • 5.  RE: Universe File COPY

    Posted 01-19-2021 13:17
    Hi Kathleen-  we have hundreds of programs that do the copy to a shared drive, our goal is not to have to change those programs.  We have one new program scanning for new files and ftping them to a windows server.   I need the scan program to be the one to check if a file is complete before the ftp.

    ------------------------------
    Sandy Barry
    ARAMARK
    ------------------------------



  • 6.  RE: Universe File COPY

    Posted 01-19-2021 14:44
    Okay then check the file for the end-of-data marker. If there then the file is complete, otherwise it's still coping the data using ftp.

    ------------------------------
    Kathleene Hunter
    Consultant
    Resolution Provider LLC
    ------------------------------



  • 7.  RE: Universe File COPY

    Posted 01-19-2021 12:41
    Hi Brian- we currently use samba shares and we are trying to eliminate them. Our security team does not approve of them.  So we have hundreds of files sitting on samba shares that we will be transferring to windows servers using an automated FTP program.

    ------------------------------
    Sandy Barry
    ARAMARK
    ------------------------------



  • 8.  RE: Universe File COPY

    ROCKETEER
    Posted 03-01-2021 09:29
    If overwriting existing files, please check both the source and target files are not in use beforehand and ensure they remain unused for the duration of the copy. As options:

    • Modify the file permissions - whether POSIX or ACLS - to ensure exclusive access for the duration.
    • Alternatively rename the relevant sub-directory structure temporarily - after checking with "fuser" before the rename and again afterwards to be certain.

    If using UniVerse 12, please be sure to review the 'uvunload' command as well to ensure any files copied or moved at the O/S level are unloaded from the System Buffer beforehand.

    ------------------------------
    John Jenkins
    Principal Technical Support Engineer
    Rocket Software Limited
    U.K.
    ------------------------------