We solved the problem by letting the script of step 2 generate a timestamp into the target file. If then the commit time of the 2nd file is newer than that timestamp, we know that the 2nd step has not been executed (properly).