LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Syndicated Linux News (https://www.linuxquestions.org/questions/syndicated-linux-news-67/)
-   -   LXer: Linux shell: Introduction to Flock (https://www.linuxquestions.org/questions/syndicated-linux-news-67/lxer-linux-shell-introduction-to-flock-4175464637/)

LXer 06-04-2013 01:50 AM

LXer: Linux shell: Introduction to Flock
 
Published at LXer:

Recently a colleague of mine should run multiple parallel jobs on a server (around 20 in our specific case), every job does “an elaboration” and this can take a time longer or shorter in respect of the others, once a job finishes its task it must read from a text file the first line that indicate the ID of a new job, it removes that ID from the top of the text file and starts to elaborate it. Problem: On a long run (a run of 50K+ jobs) it happens “frequently” that 2 jobs finish at the same time and so both take the same ID causing problems to the whole process. The solution was to use the bash function flock.

Read More...


All times are GMT -5. The time now is 06:20 PM.