java - CAMEL is processing the file before the "mv" command completes -


We are experiencing a problem in our monitor script.

The program's flow is

  • File
  • in the "script" directory in the backup script. Cac renames the file to .aaa file
  • Another bad script moves the ".aa" file to the "Destination" directory and changes the file back to ".csv"
  • CAMEL is monitoring the "Destination" directory if any file is in the "destination" folder and there is no extension equal to ".aaa", then it will start processing the file. Here the Step 3 is failing, Bash successfully transfers the script file but receives the CAML file when changing the file from ".aaa" to ".csv" and starts processing. Does. The CAM fails with the "Footer is not present" error because that "MV" command was not completed and "MV" was processed by CAM before it was completed. So it processes an incomplete file.

    Since we use scripting, we have very less flexibility in using commands, we are using the Linux "MV" command to rename the file.

    Is there a way to lock the file into Scripting while changing the name that will stop the CMML from accessing it?

    or

    thanks, Matthew Leuja

  • you step 3 How do?

      mv foo.aaa dest / foo.csv  

    or

      MV foo.aaa dest / foo.aaa MV dest / foo.aaa dest / foo.csv  

    The latter should be atomic, I think, while the first is a copy if the original and destination are on separate partition / file system.


    Comments

    Popular posts from this blog

    c# - How to capture HTTP packet with SharpPcap -

    php - Multiple Select with Explode: only returns the word "Array" -

    php - jQuery AJAX Post not working -