# Exec command after file download/upload

**URL:** https://forum.syncthing.net/t/exec-command-after-file-download-upload/6715
**Category:** General
**Created:** [February 4, 2016, 2:06pm UTC](https://forum.syncthing.net/t/exec-command-after-file-download-upload/6715 "2016-02-04T14:06:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rsd](https://forum.syncthing.net/user_avatar/forum.syncthing.net/rsd/32/7352_2.png) [@rsd](https://forum.syncthing.net/u/rsd)
#### Post date: [February 4, 2016, 2:06pm UTC](https://forum.syncthing.net/t/exec-command-after-file-download-upload/6715/1 "2016-02-04T14:06:46Z")

</div>

Hello,

Is it possible to run a script after a file of folder is done syncing?

-rsd

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [February 4, 2016, 2:28pm UTC](https://forum.syncthing.net/t/exec-command-after-file-download-upload/6715/2 "2016-02-04T14:28:48Z")

</div>

You can use the rest API and listen for events.

---

<div class="post-metadata">

### Author: ![Alex](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@Alex](https://forum.syncthing.net/u/Alex)
#### Post date: [February 4, 2016, 3:18pm UTC](https://forum.syncthing.net/t/exec-command-after-file-download-upload/6715/3 "2016-02-04T15:18:34Z")

</div>

As inspiration a program that does exactly that in Go (for every file in a folder): [https://github.com/alex2108/syncthing-owncloud/tree/master/scanner](https://github.com/alex2108/syncthing-owncloud/tree/master/scanner)

Written for owncloud but it just runs php with the needed commands which can be easily replaced by any other command.

---

<div class="post-metadata">

### Author: ![rumpelsepp](https://forum.syncthing.net/user_avatar/forum.syncthing.net/rumpelsepp/32/2006_2.png) [@rumpelsepp](https://forum.syncthing.net/u/rumpelsepp)
#### Post date: [February 5, 2016, 7:37am UTC](https://forum.syncthing.net/t/exec-command-after-file-download-upload/6715/4 "2016-02-05T07:37:46Z")

</div>

> [@Pre and Post process scripting?](https://forum.syncthing.net/t/pre-and-post-process-scripting/847):
>
> Hi Not sure if it is possible but I am wondering if we could have pre and post process system scripting (via bash, or whatever the system offers) for things like compression, encryption etc. I realize that complicates how ST needs to check files but it might be a nice feature to have.
