Chapter 01
Installation
Two Rust binaries. The server keeps the data, the client sends it. There is no installer, no runtime and no Node.js — the interface is plain HTML that is embedded in the binary.
What you need
- The server: Linux, 1 core, 1 GB of RAM, a disk for the storage.
- The client: Windows 10/11 or a modern Linux, 100 MB of RAM.
- A free TCP port for the server (8787 by default) and the
api_tokenfrom the configuration file — the client needs it to register.
Build it (or take the binary)
The custom-protocol feature is not optional for a release build: it is what embeds the console into the binary. Without it the server starts but has no interface.
Start the server
-
Choose the storage
The storage holds the chunks, the manifests, the reports, the master key and the registry. Put it on a disk with room — and remember that it is the only thing that must survive.
-
Start it
./mintsmartbackup-server --headless \ --config /etc/msb/server.json \ --storage /srv/msb/storage \ --listen 0.0.0.0:8787The first start writes the configuration, generates the master key and prints the api_token. Open http://<server>:8787/ — that is the console.
-
Firewalls and reverse proxies
The console is a normal web application. Put it behind a TLS terminating proxy if it leaves your network; the bearer token is the only thing that protects the management API.
An option the program does not know is an error (exit code 2) — it is never ignored. A typo in --storage would send the data somewhere else, so a silent mistake is worse than a crash.
Configure the client
The client writes a complete configuration on the first start. Change the three fields that matter:
- include empty means everything; exclude uses glob patterns (*, **, ?).
- respect_ignore_files honours .gitignore and .msbignore inside the tree.
- Hidden files (a name that starts with a dot) are skipped unless include_hidden is true.
Chapter 02
The first backup
Start the client. It registers itself at the server, receives its credentials and does the first run.
-
Register
The client sends its name, the hostname and the number of cores. The server answers with a client id and a session token. Both are stored in the configuration — the identity survives a restart.
-
Scan
Every source is walked in parallel. The files that did not change since the last run are skipped without being read; the rest are split into content defined chunks. A file that is written while it is read is read again, and if it keeps changing it is left out of the revision and reported.
-
Upload
The client asks the server which chunks it already has, sends only the missing ones, compresses them and puts them on the wire. The server verifies the hash of every chunk as it arrives and refuses the ones that do not match.
-
Close the session
The manifest of the revision is stored. Any file whose chunks never arrived is dropped here — the revision that reaches the disk is always complete and restorable.
-
Report
An HTML and a PDF report are written into the report directory of the client and uploaded to the server. They contain the files, the bytes, the errors and the warnings of the run.
On the first run: everything. Afterwards: only the chunks of the files that really changed. A file of 2 kB that changed completely costs 32 bytes of traffic — the rest of the data set is not even read.
Chapter 03
The console
The console of the server is a single page with five tabs. It is embedded in the binary — no web server, no CDN, no internet.
- Fleet — every client with its health, the time of its last backup, the number of failed runs, its schedule, its storage and the state of its last drill.
- Alerts — the findings of the anomaly engine with their severity, their state and the action to take. A finding can be acknowledged; it is resolved automatically when the condition is gone.
- Restore & integrity — the catalogue of the revisions, the drill, the restore into a directory or into a zip, and the file browser for a granular restore.
- Deep report — the whole fleet as HTML and as PDF: the health, the storage, the traffic of the last 24 hours, the findings and the operator actions.
- Audit — every change an operator made, with the time, the client and the result.
Every view is also available as a deep link (?tab=alerts), so a specific page can be bookmarked or sent to a colleague.
Chapter 04
Schedules
A schedule can be expressed in three ways. The earliest upcoming trigger wins:
- Interval — every N minutes.
- Daily — at a given local time, e.g. 02:30.
- Weekly — on a given weekday at that time.
If a weekday is set, the schedule is a weekly one. The daily candidate is not added in that case — otherwise it would always be earlier and the weekly schedule would silently become a daily one.
The server can enforce a schedule per client (it overrides the one of the client) and can ask a client to back up now with the force backup switch in the fleet view.
Chapter 05
Retention & immutability
How long a restore point survives is a policy, and the policy is per client (the policy of the server is the default).
- keep_last — the newest N revisions, whatever their age.
- keep_daily / weekly / monthly — one revision per day, week or month (the grandfather–father–son scheme).
- max_age_days — nothing older than this survives. It wins over the write protection.
The garbage collector
Deleting a revision does not free the disk by itself — the chunks are shared. The collector deletes the chunks that no manifest of any revision references any more. It is deliberately conservative:
- it never deletes a chunk that an open upload session refers to — a client that was told that the server already has a chunk will not send it again;
- it skips a client completely when its manifests cannot be read.
Write protection
A revision that is younger than the protection window is never deleted, and the freeze locks the whole repository. The protection always wins over the retention — that is the whole point of it.
Chapter 06
Restore
The drill — the proof
The drill decrypts and verifies every chunk of a revision. It changes nothing and it is the fastest way to find out whether a backup is really usable.
The answer contains the number of files that were checked, the number that are complete, the number of chunks that were verified and the findings. A drill that fails is an anomaly of the client.
Point in time
Every run is a restore point. The catalogue lists them:
and a restore names the revision it wants:
Granular — one file out of a revision
Both forms of the path find the file. The target directory is created, the original structure of the source is kept inside it, and every file is verified against its hash before it is written.
Safety of the paths
A manifest is untrusted input. A path that contains .., an absolute path, a drive letter or a colon is rejected; the restore never writes outside the target, whatever the manifest says.
Chapter 07
Alerting & metrics
Notifications
The server can send a webhook (JSON) or a mail (SMTP, with STARTTLS or implicit TLS). Four events are supported:
- a backup failed (the client reports the number of errors),
- a new critical anomaly appeared,
- a restore was executed,
- the protection was changed.
Metrics
The server exposes Prometheus metrics on /metrics:
Chapter 08
The Windows service
On Windows the client runs as a service so that the machine is protected from the moment it boots.
-
Register the service
Run the client once as an administrator with --service. It registers itself with the service control manager, sets the start type to automatic and starts.
-
Let it notify
The service shows a toast when it starts, so the user sees that the machine is protected. The message can be switched off in the configuration (service.notify_on_start).
-
Check it
sc query MintSmartBackupThe logs of the service are written into the work directory of the client, next to the state file.
The service is the same binary as the agent — there is no second implementation to keep in sync.
Chapter 09
The API
Two APIs live in one server. The client API authenticates with the credentials of the client; the management API with the bearer token of the server.
The client API
POST/api/v1/register — a new client registers itself and receives its id and its token.
POST/api/v1/session/open — opens an upload session; the answer contains the chunks the server already has.
POST/api/v1/session/<id>/chunk/<hash> — sends one chunk (the hash must match the content).
POST/api/v1/session/<id>/complete — closes the session and stores the revision.
POST/api/v1/heartbeat — the heartbeat; it also carries the last error of the client.
POST/api/v1/me/status — the status of the client including the restore readiness of its newest revision.
The management API
Everything below needs the header Authorization: Bearer <api_token>.
A body has to be a JSON object, and a known field has to have the right type — otherwise the answer is 400. Unknown fields are ignored, as usual for a REST API. A typo can never silently disable a protection.
Chapter 10
Troubleshooting
The short list. The long list is on the support page.
- The client does not register. Check the URL and the port. The server logs the reason: the server is not reachable, invalid client token or automatic backup is disabled for this client.
- The backup fails with “the source does not exist”. The path of the source is wrong or the drive is not mounted. The run stops before the upload — nothing empty reaches the server.
- The drill fails. The chunks of the revision are incomplete. Check the storage of the client in the fleet view; the collector can remove the chunks of a revision that was never completed.
- Nothing is transferred. The files did not change — the client sends the bytes that changed, and nothing else. Compare the mtime of the files with the time of the last run.
- The storage does not shrink. The retention deletes the revisions, the collector frees the chunks. Run POST /api/v1/storage/collect and check the write protection: it can block the deletion.