redstrate.com/content/software/hydrus-sync-client.md

27 lines
1.1 KiB
Markdown
Raw Normal View History

---
2024-02-23 22:35:59 -05:00
title: "Hydrus Sync Client"
date: 2022-10-12
draft: false
layout: "project"
2023-06-23 14:42:45 -04:00
projtags:
- Hydrus
2022-11-07 08:57:27 -05:00
- Rust
license: GPLv3
2025-04-12 11:03:07 -04:00
source: "https://code.ryne.moe/redstrate/hydrus-sync-client/"
2023-03-01 14:02:08 -05:00
summary: "Sync hydrus databases using rsync."
---
Ever feel like you need a way to sync Hydrus databases across multiple machines? With `hydrus-sync-client`, you can
2024-02-23 22:35:59 -05:00
easily synchronize your Hydrus database with a rsync server. This was originally a Bash script that I decided to rewrite in Rust, so it's pretty ugly.
2024-02-23 22:35:59 -05:00
# Process
1. The program first checks the last hostname that synchronized, this is used later to decide whether to sync first.
2. Then the lockfile is checked, if it is locked - the program exits.
3. If the hostnames don't match, we sync the files before launching.
4. Hydrus is launched and you can continue like normal.
5. Once Hydrus is closed, the file synchronization now happens in reverse.
6. Before the program exits, the lockfile is reset and the last hostname is updated.
As long as you ensure you're always using `hydrus-sync-client` to run Hydrus, the sync process is mostly foolproof.