Clean script in "post execution" in LSF

So for completeness (in case needed by anyone else). My final solution is to add the “-Ep” option to LSF in the submit.yml:

script:
queue_name: “interactive”
native:
- -Ep “”<%= staged_root %>/post.sh >> <%= staged_root %>/output.log 2>&1""

So the script I called ‘post.sh’ and attach its output (both out and error) to the output.log.
The main difference with the “clean.sh” is that this script will not be executed in the same “environment” so the env variables exported in “before.sh”, “script.sh” or others are not available in the “post.sh”. My solution was to “build” the post.sh in the “before.sh” (I ‘echo’ the commands with right values to the post.sh).
Thanks again all for your help.