Loop or check SQlite3 database continuously, when query found run script for first 3
I have a SQlite database gets populated when ever someone adds a filename and dir to it, then I want the script to read the newest 3 entries (done with the "LIMIT 3") then I want this script to take those 3 entries and start the "script1.sh" for each of them, then once the script1 has finished one of the 3, I want it to look back into the SQlite database and check if there are any new entires and repeat. (so kinda like a queue)
NOTE, at the end of script1.sh there is a command that will delete it's entry from the SQlite DB. So basically I want the script to check the SQlite DB each time one script1.sh script finishes. So far I have: Code:
#!/bin/bash |
why not make this process part of the script1.sh?
|
You can't mix a queue of len=1 and len=3. You won't be able to keep track of what's actually been processed.
Personally, I'd do the whole thing top to bottom in Perl, and name the column I need; never use 'SELECT *' in prod code, there's no guarantee that col names will always appear in the same order, even if they do right now. |
Quote:
And i'v found a solution to my question, im just using SQlite and check the status of the file ever x seconds in a continues loop :) @ chr15t0, Because .... I have my reason, just don't remember what they where right now :P |
All times are GMT -5. The time now is 08:23 PM. |