# Server wide post receive git hook to run bash script on server machine

**URL:** <https://forum.gitea.com/t/server-wide-post-receive-git-hook-to-run-bash-script-on-server-machine/2402>\
**Category:** Install/Maintain/Configure\
**Created:** [August 12, 2020, 1:34am UTC](https://forum.gitea.com/t/server-wide-post-receive-git-hook-to-run-bash-script-on-server-machine/2402 "2020-08-12T01:34:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkebler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dkebler/32/333_2.png) [@dkebler](https://forum.gitea.com/u/dkebler)\
**Post date:** [August 12, 2020, 1:34am UTC](https://forum.gitea.com/t/server-wide-post-receive-git-hook-to-run-bash-script-on-server-machine/2402/1 "2020-08-12T01:34:51Z")

</div>

I know I can set up a webhooks for server/organization wide post-receive hook. But what I have is a rsync backup bash script to be run on the same server running gitea. Currently it just runs a cron job once a day but I’d rather it run any time any repo commit is pushed to the gitea server.

Is it possible (one hook for server wide)? as opposed to a webhook If so how? I didn’t see anything in the docs.

Alternatively a hack would be to add the same post-receive git hook to every existing and new repo which I guess would effectively be the same. That’s not practical to do manually.

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [August 12, 2020, 6:56pm UTC](https://forum.gitea.com/t/server-wide-post-receive-git-hook-to-run-bash-script-on-server-machine/2402/2 "2020-08-12T18:56:47Z")

</div>

you could use global git hooks ([https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook](https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook)),but make sure that gitea’s githooks are also still run when you do that. the global githooks would need to be setup for the user running gitea on your server.
