当前位置:网站首页>Building a full-featured NAS server with raspberry pie (06): built-in file synchronization tool for penetration
Building a full-featured NAS server with raspberry pie (06): built-in file synchronization tool for penetration
2022-06-11 07:15:00 【Janvis of the stark family】
Write it at the front
That's it nextcloud, We are no longer strangers to personal online disks . But you want to synchronize files anytime, anywhere , Public network is also required IP/ Intranet through .
Actually speaking of file synchronization , There is also a built-in intranet penetration P2P File synchronization tools must be introduced , Namely syncthing.
Imagine , You are in the company / Half the files edited in the lab can still be at home / The seamless connection between the dormitory and the other half of the editor must feel great .
And this time the protagonist is no longer nas, It can be any device on the whole platform . In some synchronization scenarios ( The following is an example ) It will be very easy to use .
Syncthing What is it?
Syncthing Is a free and open source file synchronization tool , The most important thing is based on P2P technology .

The synchronization thus achieved is decentralized , That is, there is no need to have a central server to support the synchronization service . It only needs that both devices are online to complete the synchronization .
The logic of file synchronization is very similar to the nut cloud we mentioned , The usage scenario is similar , But the tools we are introducing now are free from the payment limit , To some extent, there will be a higher degree of freedom . And open source is also important for security .
install
Get into syncthing Of github Project address , Find the boot page :
Community Contributions — Syncthing v1 documentation
You can see that there are many installation methods , Can be installed on many platforms .
You can install synchronization on any device you need , For example, between computers and mobile phones or between computers and computers , It's all right .
Here we mainly talk about installing on the server , use docker-compose.
Open our old friend linuxserver.io, find doc( Pay attention to the version )

The parameters are as follows :

1.PUID and PGID
What each installation says , Fill in after query .
2.path/to/data
Set the directory address mapping of the synchronization file , It can also be modified later
3. Port number
Just keep the default , The default port number is 8384
After setting, you can deploy stack 了 .

Set up
Server side configuration
Use 8384 Ports open Syncthing

First set a password

Then it is the most basic to add a shared folder

To add a folder, you need to set these .

Note here :
1. Folder labels can be used at will , Used to identify
2. Folder ID Is the unique identifier of the share
3. The folder path is the path that we have mapped during installation ( Of course, the new path can also , But you need to map on the server first )
This interface indicates success

Other client configurations
Here we have windows Take the client as an example to demonstrate how to connect to sharing .
First download & Double-click to open SyncTrayzor.
Release Version 1.1.29 · canton7/SyncTrayzor · GitHub
There is no difference between the interface and the server side

Then you need to add a remote device ( Here, you can add it on the server side )

ID It is the long thing with two-dimensional code in the current device , The device name is given by itself .
At this time, the added end will have a confirmation message .

After confirmation, the connection is successful , You can create a shared folder locally .

Be sure to pay attention to this ID To synchronize with the folder you created at that time ID Agreement .

Then check share

Then go back to the server to confirm

Synchronous success !

Use scenarios
For the shared folders you create ,Syncthing After the connection is confirmed, the contents of the two folders will always be unified , Always consistent . It is very friendly for some scenarios that require multiple processing of office documents .
Similar to the nut cloud , Put files in a shared folder , Then the other devices connected to this folder can get a copy .
Of course , The synchronization time should be determined according to your network environment . LAN to LAN is definitely the fastest , The external network needs to use its own internal network penetration .
Basic usage :
1. You can sync your phone directly with your computer , You can also synchronize between computers .
2. But if you want to share your files elsewhere at home , It means that the devices on both sides must be turned on to connect successfully .(P2P Why )
3. You can use the server as an intermediary , Two by two , In this way, the left and right devices do not need to be turned on at any time .( Of course, the server should do a good job in the public network IP/ Intranet penetration should be more comfortable )
4. Use an infrequently used computer as an intermediary , Keep it synchronized .
Other skills
Change specific document requirements
You can change the specific requirements of shared folders in settings

Ignore mode
You can filter folders that do not need to be synchronized ( See the document for the specific use of wildcards )

version control
It is the same as synchronizing cloud disks ,Syncthing It also has version control function .
The version control here is highly selective , You can choose to keep several versions or clear the time interval, and so on .

conflict management
When a file you modify on one device has not yet been synchronized to another device , The file was also modified on another device , This will lead to file conflicts .
At this time Syncthing A new conflict document will be created for you .

You can choose to keep any of these versions .
Summary
Syncthing It can be said that it is a synchronization tool that can solve some practical problems in daily life .
The setup is not complicated , Once and for all , The function is also simple and clear , Especially the usage is very direct , Designed for synchronizing files on both sides , Safe and reliable .
If you don't need a lot of file synchronization at ordinary times , And want to be convenient and fast without being disturbed by various accounts , Then you can try it .
边栏推荐
- 教育专家王中泽老师多年经验分享:家庭教育不是附庸品
- Comparison of DOM tags of wechat applet development (native and uniapp)
- Promises/a+ standard Chinese Translation
- Promise. All capture error
- Matplotlib,设置坐标刻度大小,字体/设置图例大小及字体/设置纵横坐标名称及字体及大小
- 自动化测试的生命周期是什么?
- Education expert wangzhongze shared his experience for many years: family education is not a vassal
- **Count the characters with the largest number of words**
- [deploy private warehouse based on harbor] 3 deploy harbor
- Leetcode-9.Palindrome Numbber
猜你喜欢

Leetcode hot topic 100 topic 11-15 solution

@JsonProperty注解

JVM learning record (VII) -- class loading process and parental delegation model

Crmeb/v4.4 Standard Version open version mall source code applet official account h5+app mall source code

Listen to the left width of the browser to calculate the distance

Leetcode-104. Maximum Depth of Binary Tree

Create a form whose client area is 800 pixels by 600 pixels

Detailed explanation of mutationobserver

matplotlib的cmap

webserver
随机推荐
【CF#388 (Div. 2)】A. Bachgold Problem
Leetcode-647. Palindromic Substrings
[deploy private warehouse based on harbor] 3 deploy harbor
Quality-aware Feature Aggregation Networkfor Robust RGBT Tracking
This comprehensive understanding
Leetcode-647.Palindromic Substrings
软件测试周刊(第75期):唯有平视,才能看见真实的自己。
Shutter restraint container assembly
资深OpenStacker - 彭博、Vexxhost升级为OpenInfra基金会黄金成员
Prototype and prototype chain
1442. number of triples forming two exclusive or equal arrays
webserver
Experience record of rural housing integration script
Shuttle inside and outside margins
MS office level II wrong question record [8]
Calculate the day of the week for a specific month, year and day
Smart pointer (simple version)
Senior openstacker - Bloomberg, vexxhost upgraded to the Gold member of openinfra Foundation
554. brick wall
1、 Sqlserver2008 installation (with password), database creation, C form project test