# Run clean.sh after "delete" is selected

**URL:** <https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353>\
**Category:** Get Help\
**Created:** [July 10, 2025, 9:17pm UTC](https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353 "2025-07-10T21:17:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kstine](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kstine/32/2539_2.png) [@kstine](https://discourse.openondemand.org/u/kstine)\
**Post date:** [July 10, 2025, 9:17pm UTC](https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353/1 "2025-07-10T21:17:22Z")

</div>

Is there a way in OOD to force it to run a cleanup script before scancel-ing the job?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [July 11, 2025, 7:09pm UTC](https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353/2 "2025-07-11T19:09:44Z")

</div>

No and infact it only runs if the process itself is destroyed. I.e., You’ve booted matlab and the user clicks the exit on matlab ending the script.

I think what you’re looking for is more along the lines of a Slurm epilogue.

---

<div class="post-metadata">

**Author:** ![kstine](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/kstine/32/2539_2.png) [@kstine](https://discourse.openondemand.org/u/kstine)\
**Post date:** [July 14, 2025, 6:14pm UTC](https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353/3 "2025-07-14T18:14:16Z")

</div>

Is there a way to modify the delete button then? That way, we could have it run `clean.sh` before scancel.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [July 14, 2025, 7:10pm UTC](https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353/4 "2025-07-14T19:10:25Z")

</div>

> [@kstine](#):
>
> Is there a way to modify the delete button then?

Hmmmmm, I don’t think so. The `delete` button use `scancel` or similar to stop the job. Seems like a solution like that would need to find the host, ssh to it, run the script, then do something else.

So in all, no I don’t think it can do that.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [January 10, 2026, 7:10pm UTC](https://discourse.openondemand.org/t/run-clean-sh-after-delete-is-selected/4353/5 "2026-01-10T19:10:57Z")

</div>

Closed on January 10, 2026, 7:10pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
