# Understanding kopia actions

**URL:** <https://kopia.discourse.group/t/understanding-kopia-actions/2956>\
**Category:** General Topics\
**Created:** [May 30, 2024, 10:01pm UTC](https://kopia.discourse.group/t/understanding-kopia-actions/2956 "2024-05-30T22:01:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlssmt](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@jlssmt](https://kopia.discourse.group/u/jlssmt)\
**Post date:** [May 30, 2024, 10:01pm UTC](https://kopia.discourse.group/t/understanding-kopia-actions/2956/1 "2024-05-30T22:01:56Z")

</div>

Hello,

I created an “After Snapshot” script to ping [healthchecks.io](http://healthchecks.io) when the backup finished.  
Will this script also run when the snapshot failed?  
What is the “After Snapshot Command Mode” for?  
And what is the difference between after snapshot and after folder?

Thanks in advance 🙂

```bash
#!/bin/bash
while getopts u: flag
do
case "${flag}" in
    u) uuid=${OPTARG};;
esac
done

/usr/bin/curl -fsS --retry 3 https://hc-ping.com/$uuid
exit 0

```

---

<div class="post-metadata">

**Author:** ![jlssmt](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@jlssmt](https://kopia.discourse.group/u/jlssmt)\
**Post date:** [July 10, 2024, 9:04pm UTC](https://kopia.discourse.group/t/understanding-kopia-actions/2956/2 "2024-07-10T21:04:45Z")

</div>

nobody? my questions are still open ☹

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [July 11, 2024, 4:00am UTC](https://kopia.discourse.group/t/understanding-kopia-actions/2956/3 "2024-07-11T04:00:29Z")

</div>

> [@jlssmt](#):
>
> Will this script also run when the snapshot failed?

It should but like many things in kopia if your life depends on it better test or check source code (and still test)🙂 And share results with others.

> [@jlssmt](#):
>
> What is the “After Snapshot Command Mode” for?

It defines how action is run (sync vs async) and how its exit status influences backup exit status.

> [@jlssmt](#):
>
> And what is the difference between after snapshot and after folder?

One is run after snapshot is finished and the other after specific folder backup (can be many times within one snapshot for different folders). Please note that you can’t assign “before/after folder” actions to specific folders using GUI - if you need it check documentation and use CLI.
