in reply to Locking/unlocking program execution using a queue

Hi,
Might not be what you want as you already have the support for the lockfiles in each directory, perhaps from other tasks but....
Rather than having a lock file in each directory, just maintain a file that has the paths of the directories that allowed to be visited/have been processed. As you would be traversing the list sequentially you would not have to worry about doing things out of order.
Everytime you complete a task for a particular directory you could save the line number (which directory you did last) to another file so you could restart if the script bailed out for some reason.
An advantage of this is you don't have to skip in and out of all the directories to see if you need to do work. The list maintains where the work is to be done.
Just a thought... =)

Regards Paul.
  • Comment on Re: Locking/unlocking program execution using a queue