Monitoring shell script
I'm having to write a script to make up for a command line products shortfalls.
The command will kick off multiple background processes, the number of processes is based on the number of filenames in a given file; workspace.lst.
Each process will create a logfile with the same name as the input filename in a directory; LOG_DIR.
I don't know how long it will take each process to complete, but for this exercise I can assume no more than 1 hour.
I need to grep each log filename in workspaces.lst in LOG_DIR for the existance of a "Success" string. If it exists, processing for that filename is done and check the others. If it doesn't I want to wait 5 minutes and check again. If after 60 minutes all are complete, exit. Or if after 60 minutes some logfiles do not contain the success string, assume failure.
I can't even seem to pseudo-code this, much less bash script it. If anyone is bored and has some time, your help would be greatly appreciated.
Last edited by dsevern; 01-05-2011 at 03:37 PM.
|