When a task fails during execution, it can be reran, either using e.g. using execution retry
or via the web UI (which uses cylc trigger
).
However, if the job failed midway, it likely has generated a number of files in its work
directory, which will interfere with the new execution.
Of course, an advanced job may either look at $CYLC_TASK_TRY_NUMBER
or simply perform an absurd number of checks to make sure every single output exists and isn’t corrupted before recreating it, but for the vast majority of jobs it seems to be that it would be easier to wipe the work dir before executing again.
Is there a built-in utility when triggering a new task to wipe its work dir, or do we need to add rm -rf *
at the start of every single script ?