Backup and synchronization summary

Disk failure costs. As a general rule, all valuable data should be kept in copy, preferably on different devices, in real time, and with 2-way sychronization support.

In the early days I had been using robocopy with batch script, rsync with shell script, even adb-sync with batch/shell scripts. Configurations were complex, the backup system was vulnerable to various compatibility problems (typically system locale problems and path naming restrictions). The backup was also not in real time, nor does these methods support 2-way sychronization due to the absense of a database.

Commercial solution costs, while a lot of open-source solutions do not work in a real-time fashion.

Syncthing is a great tool to solve the problems above. It even comes with bundled NAT traversal capability. A typical backup network shows as below,

private
NAS
private...
workgroup
NAS
workgroup...
workgroup
devices
workgroup...
private
devices
private...
Text is not SVG - cannot display

where arrow shows backup direction, solid line represents user files, and dash line represents system files.

Some personal files are sychronized across devices as needed, while backup operations typically have the following ignore cases.

Linux user

.stignore at $HOME

/.cache
/.conda
/.config/syncthing/index*
/.local/share/tracker
/.nvm
/.npm
/.rbenv
/.vscode-server
/installation
/go
/repos/**/node_modules
/repos/**/node_cache
/**/cache

Linux root

.stignore at /

!/etc/nginx/nginx.conf
!/etc/nginx/conf.d
!/var/lib/postgresql
*

Windows user

.stignore at %userprofile%

\.vscode
!\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
\AppData
\Documents\Tencent Files\*\TIM\Registry2.0.db
\Documents\Tencent Files\*\TIM\Registry2.0.db-journal
\Music
\notes
\OneDrive*
\repos\**\node_modules
\repos\**\node_cache
\Searches
\Videos
(?i)\NTUSER*