24 lines
935 B
Markdown
24 lines
935 B
Markdown
|
+++
|
||
|
title = "Syncing works"
|
||
|
date = 2024-09-08
|
||
|
updated = 2024-09-08
|
||
|
[taxonomies]
|
||
|
tags = ['self-hosting', 'zola', 'automation', 'systemd']
|
||
|
+++
|
||
|
|
||
|
## rsync and 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!
|
||
|
|
||
|
## Resources
|
||
|
|
||
|
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/)
|