Hi folks,
another problem.
I'm using the following command to monitor the states of print jobs:
The Output of each grep is stored in a variable. As soon as the variable's value becomes greater than 0 there's a message being displayed on my monitoring box saying "Some jobs have failed" or "Some jobs have been aborted" and so on ...
However because there's an enormous directory structure existing under /data/ each find-grep combination takes a significant amount of time to complete.
Now the question is: Is there any way to get rid of 2 of the 3 find-grep commands and accomplish the same goal using only 1 find-grep ?
Regards
Thomas
another problem.
I'm using the following command to monitor the states of print jobs:
Code:
chk1=$(find /data/ -name job.history -exec grep -l FAILED {}\; | wc -l)
chk2=$(find /data/ -name job.history -exec grep -l WAITING {}\; | wc -l)
chk3=$(find /data/ -name job.history -exec grep -l ABORTED {}\; | wc -l)
The Output of each grep is stored in a variable. As soon as the variable's value becomes greater than 0 there's a message being displayed on my monitoring box saying "Some jobs have failed" or "Some jobs have been aborted" and so on ...
However because there's an enormous directory structure existing under /data/ each find-grep combination takes a significant amount of time to complete.
Now the question is: Is there any way to get rid of 2 of the 3 find-grep commands and accomplish the same goal using only 1 find-grep ?
Regards
Thomas