Looking for advice. Writing a simple bash script. It will check percentage of income files in folder every 30 min. So we know expected total number of files and till what time they all should be in folder.
So I got stuck with appending value "verification status". If percent of income files is equal or higher then expected, than set status is verified and send email with current data as HTML table. So each script run appending data to file which will to the HTML table.
| Time | Files count| Files rate | Status | |14:31 21.01.18| 18567 | 15,6% | Verified | |15:01 21.01.18| 21402 | 19,2% | Failed |
Couldn't find solution how to make same script run and check different condition. To me the logic seems to be like that:
if 1st script run and files rate is equal or lower 15% then status=Verified else status=Failed
if [ $attemptrun -eq 2 ] && [ $filerate -gt 15 ] then status=Verified else status=Failed
But how to make that each additional script run, expecting and checking different file rate, like 1st run =< 15, 2nd =<22, 3rd =<35 etc ?