this post was submitted on 22 Nov 2023
49 points (94.5% liked)

Selfhosted

40492 readers
209 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

What are you non-obvious, maybe strange usecases of Syncthing?

For example syncing the media library with your friend or maybe your entire /home/user folder between your PC and laptop?

I'd love to hear your ideas!

all 44 comments
sorted by: hot top controversial new old
[–] tjhart85@kbin.social 18 points 1 year ago

I've got a couple of Raspberry Pi Zero's that emulate a mass storage device (basically it acts like a USB drive) that I have connected to 3D printers and my wife's embroidery machine.

Instead of using it with a network share like in the link, I share the folder with SyncThing.

It's super convenient to not have to move a USB drive around and can just leave it connected and get the files on there seamlessly.

Syncing save games across multiple users, for games like Valhiem or Minecraft without the need for an always on server.

[–] m@social.tthi.as 9 points 1 year ago

I use it to synchronise RetroArch save states across my devices - desktop PC, Android TV, and Android handheld.

[–] anzo@programming.dev 9 points 1 year ago (2 children)

Installation on phone from F-droid (Syncthing-fork) gives a 1-way share of your Camera to backup to PC whenever you get back home. That's my top usecase... Together with syncing KeePass database since long ago too.

[–] qdJzXuisAndVQb2@lemm.ee 1 points 1 year ago (1 children)

I have a keepass database synced between a phone, desktop and a Raspberry Pi 1. The Pi just sits as an always-on server. I don't edit it on my phone. Here's my problem: when I edit something on my desktop and save it I invariably get a file conflict error and have to force the Pi to accept the new 'conflicted' file from my desktop. Any idea why? It's incredibly annoying!

[–] thegreekgeek@midwest.social 4 points 1 year ago (1 children)

I think you need to set up database syncronization in keepass. I had this issue for a bit until I enabled this. Basically you set a copy that's synced with syncthing outside of your keepass folder, then another copy that keepass edits directly. Then you can set it up so that when it saves the database in keepass it will sync the edits in the one that's mirrored y syncthing.

[–] qdJzXuisAndVQb2@lemm.ee 1 points 1 year ago

Thank you, i'm going to look into this!

[–] wittless@lemmy.world 8 points 1 year ago* (last edited 1 year ago) (3 children)

I have a site to site VPN between my house and my mother's house. I keep a raspberry pi at her house with a 2TB drive running syncthing. My photo library and important documents sync to her house as an offsite backup in case my house ever burned to the ground.

as far as syncing files between PC and laptop, I would think ownCloud would be better suited for that.

[–] cmnybo@discuss.tchncs.de 9 points 1 year ago (1 children)

as far as syncing files between PC and laptop, I would think ownCloud would be better suited for that.

The main purpose of Syncthing is syncing files between two or more computers and it does an excellent job of that.

[–] JustEnoughDucks@feddit.nl 1 points 1 year ago (1 children)

True, keeping a not-necessarily-synced repository of files is more own/nextcloud's thing.

[–] bastion@feddit.nl 1 points 1 year ago

This comes off as a sick burn.

[–] BearOfaTime@lemm.ee 5 points 1 year ago* (last edited 1 year ago)

I'm currently building the same setup, the long-term goal being a Crashplan-type solution (back when they had a feature where you could backup to your friend's devices).

Having a large family, there a many geographically distributed locations for us all to use.

As for OwnCloud, ST is far simpler to setup. Granted, it's not nearly as flexible. I do use it to keep all our laptops and phones "backed up" to a desktop that runs Crashplan and Backblaze.

Edit: With ST that VPN isn't even required. It will sync, encrypted, over most any connection.

[–] mypasswordis1234@lemmy.world 4 points 1 year ago (3 children)

Ok, why syncthing and not rsync? Also, duplication should not be threated as backup.

[–] wittless@lemmy.world 3 points 1 year ago (1 children)

because synching runs all the time. any change that I make is nearly immediately updated offsite. and if you think that is my only backup of my photos, you would be wrong :-) This is only a "if I lost all my physical possessions" type backup, not an "oops, I am a dummy and deleted something I shouldn't have" backup. I have multiple snapshot backups and also run incremental backups every hour. Storage is so cheap any more that I don't hesitate to have 5 backups of the REALLY important stuff. Most of my server storage is also raid5 in case of hardware failure. I have pushover set up to check for disk failures and push alerts to my phone if one is ever detected.

[–] mypasswordis1234@lemmy.world 1 points 1 year ago (1 children)

Oh, okay! thanks for the clarification. What are you using for incremental backups?

[–] wittless@lemmy.world 2 points 1 year ago

my primary laptop is a Mac, but my main server is a proxmox host running many containers for various things. one is a samba server that holds my Time Machine backups.

[–] BearOfaTime@lemm.ee 3 points 1 year ago

ST has stupid-simple clients for every OS. Rsync doesn't (though it's more capable in my opinion).

[–] avidamoeba@lemmy.ca 2 points 1 year ago

It can be if the off-site duplicate has automatic snapshots.

[–] aluminium@lemmy.world 6 points 1 year ago

I don't know if these are uncommon but I have a few cool usecases besides the regular 1:1 folder syncing, maybe someone else finds them useful.

Also you should know that the way I have all of this setup is that I have a container that hosts a bunch of SMB Network drives and a syncthing container that stores all of the fodlers on that drive. Having them also easily accessible through smb is great when I just wanna quickly copy something or back the folders up.

So here are some of my maybe unorthodoz usecases :

  • Music - As a fan of offline music, I have it setup that music I acquire gets synced onto the server and re-encoded as opus through a script into a second folder which then through syncthing gets sent out my mobile devices. There I rather have smaller files than lossless quality. Said script also sorts the music into folders based on artist and album metadata.
  • I also sync my Newpipe Subscriptions between phones (unfortunately by manually exporting my settings and re-importing them)

I also used to have a setup that would sync Minecraft Bedrock and Stardew Valley saves between devices (where Windows and Android saves are compatible) but Android 11 introduced a stupid restriction that prevents synching from accessing the the saves are located on Android.

[–] Takahe 5 points 1 year ago (1 children)

I have become quite invested in Logseq, noting down everything from terminal commands, to shopping lists and recipes. Syncing the .md files between my desktop, laptop phone and work pc with ST works amazing.

[–] Cyber@feddit.uk 3 points 1 year ago

+1 Came here to say the same thing.

And if there's a conflict, well, you just end up with both files (rather than neither)

IMHO, I think the Logseq devs should forget about their sync - but I understand that they need something to attract funding...

[–] slazer2au@lemmy.world 5 points 1 year ago

Working for a sip provider.

We used syncthing to sync sound files between sip servers. Things like voicemail, call recordings, hold music, menu options.

[–] cmhe@lemmy.world 4 points 1 year ago* (last edited 1 year ago)

I mod my games on my PC and sync it to my SteamDeck. I also sync the save files back and fourth, to continue playing on different devices. Mostly non-steam games.

I also sync my eBook collection to my eink reader with syncthing.

Everything is also mirrored to my always-on NAS, so syncing always works.

[–] zaphod@lemmy.ca 4 points 1 year ago* (last edited 1 year ago) (1 children)

Echoing other comments, my backup strategy for all our devices is: Syncthing to replicate data to my NAS, restic to generate encrypted backups, and then cron+rclone to offsite those backups to Google Drive.

I absolutely love this setup.

  1. It works anywhere. Syncthing takes care of firewall punching and all that so whether I'm at home or on the road, I know the data is being replicated correctly.

  2. It's immediate. Syncthing doesn't run on some schedule. It's constantly replicating so I know at minimum there's a copy of all my data if something catastrophic happens.

  3. It's private, encrypted, and entirely in my control.

  4. The setup is built of composable parts that can each be understood, modified, and debugged easily.

Normally I'm a little cautious about rolling my own infrastructure for something critical like backups, but this setup is so simple and robust that I just don't worry about it.

Other use cases I've come up with:

  1. I use Paperless as a DMS. It has a watch folder for automatically ingesting documents. I set up Genius Scan + Syncthing on my phone, syncing scans to the Paperless drop folder, so I can scan from my phone and automatically upload to Paperless without any additional app. Just scan and off it goes.

  2. For a while I was playing Subnautica on my Steam Deck and my gaming rig. Subnautica doesn't support the Steam Cloud so I used Syncthing to replicate the save data across my gaming devices.

Not particularly weird or outlandish, but of course I also use Syncthing to replicate my keepass database across devices as well.

I also have a personal wiki of Markdown notes that I sync between my laptop and phone using Syncthing.

Oh, and I use it to replicate my Calibre library between my laptop and my calibre-web server.

Basically it's my swiss army knife of "I have data over here, I need to get that data over there" and it's amazing!

[–] lemmyvore@feddit.nl 1 points 1 year ago (1 children)

How does syncthing know what to upload to paperless watch dir if paperless keeps deleting the files after ingesting them?

[–] zaphod@lemmy.ca 2 points 1 year ago (1 children)

That'd exactly what you want! When the file initially lands in the sync folder, Syncthing sends it to paperless. Paperless ingests it, deletes it, and it disappears from my phone, now stored in paperless. Exactly what I need.

If I wanted the files to stay on the phone I'd set up the phone as Send Only and the paperless side as Recieved Only.

[–] lemmyvore@feddit.nl 1 points 1 year ago* (last edited 1 year ago) (1 children)

Oh you delete them from the phone too, ok that makes sense.

I don't delete them from the phone (because they're also in a different app I used since before Paperless) so that's a bit of a dilemma. I'll have to think about it better.

[–] zaphod@lemmy.ca 2 points 1 year ago (1 children)

Again, Syncthing supports one-way sync so allowing paperless to delete them and having that delete sync back to the phone is entirely optional.

[–] lemmyvore@feddit.nl 1 points 1 year ago (1 children)

I mean, how does Syncthing know not to copy a file again if it copied it once and paperless deleted it?

[–] zaphod@lemmy.ca 2 points 1 year ago* (last edited 1 year ago) (1 children)

The client on the sender side (the phone) knows it sent the file. It doesn't care if the receiver side changed or deleted it. It sent the file. Its job is done. That's why the mode is called "Send Only".

Meanwhile the client on the receiver side (my NAS) never pushes changes back. It only responds to received sync instructions. That why the mode is called "Receive Only".

It's... all pretty simple. Not sure where the confusion lies?

[–] lemmyvore@feddit.nl 2 points 1 year ago (2 children)

The phone sync client would have to remember all the files it ever sends, which could be thousands. I've never seen a sync client that works like that, they usually compare the files that are in the source and destination folders. If syncthing can do this that's really interesting.

[–] zaphod@lemmy.ca 2 points 1 year ago* (last edited 1 year ago)

No it doesn't.

Syncthing only needs to remember the current state of the files/folders it's syncing. Not everything it's every sync'd.

It does that by either periodically scanning the filesystem to look for changes since it last scanned (based on the file creation and modification dates that are stored in the filesystem), or it registers with the operating system to receive events when files are created, modified, or deleted.

When Syncthing notices a create, update, or delete, it pushes those changes to the receiver and then updates it's record of the filesystem state accordingly.

It also pushes whole files, not deltas. So it doesn't care how the files changed, only that they did.

Even with hundreds of thousands of files to sync this is a relatively small amount of state as it's just file paths and their create/modify dates.

[–] lemann@lemmy.one 4 points 1 year ago

Sending files from my phone to my laptop - just copy them to a special folder and boom, sent 😁

[–] lnxtx@feddit.nl 3 points 1 year ago (2 children)

Using it in an enterprise environment?

[–] BearOfaTime@lemm.ee 4 points 1 year ago

While it may seem unusual to us, a major financial supporter of ST uses it just that way as a third party vendor/consulting service.

[–] slazer2au@lemmy.world 2 points 1 year ago

Yep, done that.

[–] sCrUM_MASTER@sh.itjust.works 3 points 1 year ago

Currently just use it for backing up KeePass and uni files across two laptops and a phone.

I think it would be fun to use it for storing DRM free games (like from GOG) and sharing them with friends. Create a big dump of games and share them with each other. Maybe even share save files in games where that's common.

[–] vext01@lemmy.sdf.org 3 points 1 year ago (1 children)

For a while I was exchanging encrypted backups with a friend. An easy way to offside without granting shell accounts.

[–] qdJzXuisAndVQb2@lemm.ee 2 points 1 year ago

Ha, i have planted a few rasoberry pi zeros running just syncthing in a few relatives' places for that. I worry about a blackout damaging them, so i have a few. Syncthing is great, as soon as a backup is made, it whisks it off all over the place, amazing.

[–] Cyber@feddit.uk 2 points 1 year ago

Sync (one-way) from our phones to an always on tablet in the house - the screensaver is a photo gallery so now we actually SEE those photos we take.

Just update the exclusion list (on the tablet) every now and again to ignore older photos (ie 2023-10*) and it keeps them fresh.

[–] lue3099@lemmy.world 1 points 1 year ago

I use syncthing to sync the sysvol folder between my two samba ad domain controllers.

[–] bastion@feddit.nl 1 points 1 year ago

A folder for backgrounds, shared between gf and i.

We can change each other's currently active background.

Also, synchronization of game assets - i save a template, and it almost immediately becomes available in her game.