New: detect_failed_batch_scripts.rb; TODO: refactoring, it's adhoc code