script to check database for sequential failing jobs