X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=examples%2Fcron%2Fcron.py;h=6e0667deac9da60ef61c96b217e04f5fb327a1e6;hb=6cc5bbeafe0451254bfc5cd3460061b1d3693c2d;hp=4b7d5eb1922d33f7ce54a912d5c4cd963c399fb0;hpb=1a7c80a685d91febd27879f3ff1628b159ccf298;p=pyutils.git diff --git a/examples/cron/cron.py b/examples/cron/cron.py index 4b7d5eb..6e0667d 100755 --- a/examples/cron/cron.py +++ b/examples/cron/cron.py @@ -90,7 +90,7 @@ def run_command(timeout: Optional[int], timestamp_file: Optional[str]) -> int: logger.debug( f"____ (↑↑↑ subprocess finished in {t():.2f}s, exit value was {ret} ↑↑↑) ____" ) - if timestamp_file is not None and os.path.exists(timestamp_file): + if ret == 0 and timestamp_file is not None and os.path.exists(timestamp_file): logger.debug("Touching %s", timestamp_file) file_utils.touch_file(timestamp_file) return ret