1
Fork 0
Sync hydrus databases using rsync
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
2022-10-11 21:30:25 -04:00
src Okay, finally fix linux detection 2022-10-11 21:30:25 -04:00
.gitignore Add initial files 2022-10-11 20:49:19 -04:00
Cargo.lock Add initial files 2022-10-11 20:49:19 -04:00
Cargo.toml Add initial files 2022-10-11 20:49:19 -04:00
LICENSE Add initial files 2022-10-11 20:49:19 -04:00
README.md Add initial files 2022-10-11 20:49:19 -04:00

hydrus-sync-client

Ever feel like you need a way to sync Hydrus databases across multiple machines? With hydrus-sync-client, you can easily synchronize your Hydrus database with a rsync server.

This was originally a Bash script that I decided to rewrite in Rust, so please excuse how ugly it is right now :-)

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.

Running

Before you can run hydrus-sync-client, fill out a hydrus-sync.toml config file:

rsync_password = "password"
rsync_url = "rsync://yournas/hydrus"
hydrus_db_location = "/home/yourname/.local/share/hydrus/db/"
hydrus_exec_location = "/usr/bin/hydrus-client"

Of course you need a rsync server accessible from your machine. I personally use the one built-in to Synology NAS and it works just fine.