website-zola/content/blog/2024-09-08-sync-working.md

18 lines
862 B
Markdown
Raw Normal View History

2024-09-08 21:31:46 +02:00
+++
title = "syncing works"
[taxonomies]
tags = ["self-hosting", "zola", "automation", "systemd"]
+++
I am quite 🤩 ecstatic 🤩: I got a seamless sync working between my local Git-controlled site content and my server! The way I did it:
1. use rsync to sync local files to the server in a normal user-owned folder
2. setup another rsync-script owned by the `zola` user on the server
3. create a `systemd` unit path and service that syncs these files with the proper ownership to the folders where the `zola` service watches for changes
4. 💸 profit!
Online resources that helped me with this:
- [Using systemd Path Units to Monitor Files and Directories](https://www.putorius.net/systemd-path-units.html)
- [How to run systemd service as specific user and group in Linux](https://www.golinuxcloud.com/run-systemd-service-specific-user-group-linux/)