syncthing
syncing your data
Table of Contents
1. Syncing data with syncthing
I guess everyone who owns some kind of "smart phone" knows this: you take a lot of photos and videos and want to backup your data afterwards. But you don't want to do this manualy all the time. So you take a look around to see if there is any handy application that solves your problem…
After reviewing and testing some icky apps from random NAS vendors, your phone might even ask you if you want to save your data with the help of $cloudservice
.
But you do not want to store your data on other peoples computers.
You can use your "some kind of NAS storage" (might even just be a simple desktop computer or a raspberry pi :D) at home together with syncthing for this purpose.
I think syncthing is a great tool. It's code is free and it's really easy to use.
1.1. Installation
You should be able to install it somewhat like this on gentoo:
emerge -va net-p2p/syncthing
which installs this ebuild:
* net-p2p/syncthing Latest version available: 1.1.4 Latest version installed: 1.1.4 Size of files: 18.140 KiB Homepage: https://syncthing.net Description: Open Source Continuous File Synchronization License: Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0 Unlicense
On ubuntu/debian it might look like this:
sudo apt install synthing
or like that:
sudo apt-get install synthing
1.2. Usage
After successfully installing syncthing, you can start it from your shell like that:
$ syncthing [monitor] 00:12:26 INFO: Starting syncthing [ASDF] 00:12:26 INFO: syncthing v1.1.4 "Erbium Earthworm" (go1.12.13 linux-amd64) portage@thinkpad 2019-12-20 14:15:39 UTC [ASDF] 00:12:26 INFO: My ID: ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD [ASDF] 00:12:27 INFO: Single thread SHA256 performance is 400 MB/s using minio/sha256-simd (350 MB/s using crypto/sha256). [ASDF] 00:12:27 INFO: Hashing performance is 339.33 MB/s [ASDF] 00:12:27 INFO: Ready to synchronize "Alle Geräte" (default) (sendreceive) [ASDF] 00:12:27 INFO: Overall send rate is unlimited, receive rate is unlimited [ASDF] 00:12:27 INFO: Using discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD [ASDF] 00:12:27 INFO: Using discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD [ASDF] 00:12:27 INFO: Using discovery server https://discovery.syncthing.net/v2/?noannounce&id=ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD [ASDF] 00:12:27 INFO: TCP listener ([::]:22000) starting [ASDF] 00:12:27 INFO: Completed initial scan of sendreceive folder "Alle Geräte" (default) [ASDF] 00:12:28 INFO: GUI and API listening on 127.0.0.1:8384 [ASDF] 00:12:28 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/ [ASDF] 00:12:28 INFO: My name is "thinkpad" [ASDF] 00:12:28 INFO: Device ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD is "pixel" at [dynamic] [ASDF] 00:12:28 INFO: Device ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD-ASDFASD is "klotz" at [dynamic]
As we can see it has opened port 8384 - running it's Webinterface:
[ASDF] 00:12:28 INFO: GUI and API listening on 127.0.0.1:8384
When we visit this page with our webbrowser we can configure syncthing.
Figure 1: This is a sample screenshot from my webbrowser
Syncthing listens on port 22000, too (for syncing with other instances):
[ASDF] 00:12:27 INFO: TCP listener ([::]:22000) starting
So if you configured a fixed IP for your NAS at home and your cellphone when it's using your wifi at home, then you can switch off every discovery option but local search
and set the addresses to something like `tcp://192.168.0.10:22000` rather than setting them to dynamic
.
I did it this way, because I wanted to sync my stuff only when I am at home joining my local wifi.
If you want to sync wherever you are, you'd have to have a public IP address for your NAS (I really did not want this) or switch on some of these NAT piercing options.
You'll probaply want to think about which device only sends and which device only receives data, or what to do if one of the devices deletes a file. There is a rich documentation and they are even using an irc channel (#synthing), where you can talk to the developers.