# Script

**URL:** <https://hub.mender.io/t/script/328>\
**Category:** Update Modules\
**Created:** [March 12, 2019, 9:06am UTC](https://hub.mender.io/t/script/328 "2019-03-12T09:06:43Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![nishad1092](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nishad1092](https://hub.mender.io/u/nishad1092)\
**Post date:** [June 24, 2020, 3:19pm UTC](https://hub.mender.io/t/script/328/22 "2020-06-24T15:19:42Z")

</div>

Yes, Exactly, I need a rollback condition to remove those three files and go back to ,y script1.py. I’m kinda stuck on the logic. Could you give me an example how to modify the script module please, if you are okay with it.

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [June 24, 2020, 6:08pm UTC](https://hub.mender.io/t/script/328/23 "2020-06-24T18:08:31Z")

</div>

You just need to add the logic into the “ArtifactRollback” portion of the case statement that @lluiscampos posted above. You probably also need to add logic into the “ArtifactInstall” state to actually backup the current files to somewhere persistent.

Drew

---

<div class="post-metadata">

**Author:** ![nishad1092](https://avatars.discourse-cdn.com/v4/letter/n/5fc32e/32.png) [@nishad1092](https://hub.mender.io/u/nishad1092)\
**Post date:** [June 24, 2020, 6:24pm UTC](https://hub.mender.io/t/script/328/24 "2020-06-24T18:24:42Z")

</div>

Sure, I’ll give a try. I’m going to follow example from here, hope its similar [https://docs.mender.io/2.3/devices/update-modules#power-loss](https://docs.mender.io/2.3/devices/update-modules#power-loss)

[Previous page](https://hub.mender.io/t/script/328.md?page=1)
