# Space Backup: everything for AI agents in one file Source: https://spacebackup.net/llms-full.txt (built from the repository's agent/skill, docs/mcp.md and the manual's CLI chapter). Map: https://spacebackup.net/llms.txt ## Agent quick start 1. Install Space Backup on this computer (per user, no admin or root; prints one JSON result, `"ok":true` = installed and running): - Linux: `curl -fsSL https://spacebackup.net/install.sh | sh` - Windows (PowerShell): `irm https://spacebackup.net/install.ps1 | iex` - macOS: download the .dmg (https://spacebackup.net/download/; the file is in https://spacebackup.net/download/latest.json, `platforms.macos`), drag Space Backup to Applications and open it once. The command: `"/Applications/Space Backup.app/Contents/MacOS/spacebackup"` Linux result: `warnings` are optional steps that did not work (the install is fine), `next` are the steps below with full paths. 2. Linux: if the result says `"linger":false`, tell the user to run `sudo loginctl enable-linger $USER` (the service stops at logout otherwise, so no backups at night). The installer never runs sudo; do not run it without asking. 3. Connect the local MCP server: `claude mcp add --scope user space-backup -- spacebackup mcp` (Windows: `-- sbctl mcp`). If `spacebackup` is not on PATH, give the full path: `~/.local/bin/spacebackup` on Linux, `%LOCALAPPDATA%\Programs\SpaceBackup\sbctl.exe` on Windows, the app path above on macOS. Restart the agent session (or `/mcp`) so the tools appear. 4. Sign in: `account_signin` with the user's email (CLI: `spacebackup account signin `). A mail brings a link and a 6-digit code: the user clicks the link, or gives you the code and you call `account_code `. Then `account_status`: signed in, the company, encryption ready. 5. Check: `status` (the daemon runs, the company, devices). Then do what the user asked: the skill below has the common jobs and the rules. --- --- name: space-backup description: Operate Space Backup, the backup app that copies a company's folders to its own computers and drives (Windows, macOS, Linux, iPhone). Use when the user asks to back up a folder, run a backup now, check whether backups are healthy, find or restore a file, folder or photo, see what happened last night, or manage destinations, paired PCs, the company key, albums or sharing. Works through the Space Backup MCP tools (status, folders_add, now, restore, ...) or the command line (sbctl on Windows, spacebackup on macOS/Linux) with --json. --- # Space Backup Space Backup copies folders of this computer to its **destinations**: drives of this PC and the drives of the company's other PCs (**peers**, paired by the same company key; backups stored on another PC are encrypted). Every run writes a **date folder** (`YYYY-MM-DD`) per destination; unchanged files are hard links, so each date folder is a full, browsable copy. Photos from iPhones, iCloud Photos and Google Drive are backed up the same way. ## How to call it - **MCP tools** (preferred when present): one tool per command, the command's words joined by `_`: `status`, `folders_add`, `runs_show`, `photos_search`. Positional arguments go in `args` (an array, in order), each option is a property of the same name without `--` (`{"args": ["/home/me/Projects"], "frequency": "weekly"}`), a flag is `true`. The result is the command's JSON plus `exitCode`. - **Command line**: `sbctl --json` (Windows), `spacebackup --json` (macOS, Linux). Always use `--json` and read the exit code. The CLI never prompts. - Give paths **absolute**. Windows paths as Windows writes them (`D:\Projects`). Exit codes: **0** ok · **1** error · **2** bad usage (nothing was done) · **3** Space Backup is not running (`start`) · **4** partial: it ran, but some files or destinations failed (read the document, then `runs_show last`) · **5** needs admin/root · **6** not invited to the company yet · **7** this computer needs another name (`settings set machine-name `). Details: [references/exit-codes.md](references/exit-codes.md). ## Rules 1. **Never delete, remove, forget, overwrite, stop, change keys or change who can read what unless the user asked for exactly that, in this conversation.** That means `folders_remove`, `dest_remove`, `dest_forget`, `key_*` (except `key_fingerprint`), `account_members`, `account_groups`, `devices_remove`, `devices_approve`, `approvals_*`, `share_*`, `albums_delete`/`_remove`/`_unshare`/`_share`, `photos_delete`, public links, `account_signout`, `stop`, `cancel`, `restore` with `overwrite`. These tools are marked destructive; ask first and say what it will do. 2. **Restore to a new folder first** (`restore` with `to` = an empty folder), let the user compare, and restore in place only when they ask. Never pass `overwrite` unless the user said to replace the current files. 3. **Do not print the company key.** Answers show key material as `[hidden]` (status's `companyKey` too); that is normal, not an error. `key_show` (the key) and `photos_open` (the viewer's secret) are refused unless `reveal` is their command's name (`"key show"`, `"photos open"`): give it only when the user asked for exactly that by name, and never put the secret in a file, a commit, a chat message or a log. To compare two PCs' keys use `key_fingerprint`. To set a key, prefer `key_set` with `file`. 4. Removing a folder or destination never deletes backups that already exist; say so when the user worries. 5. Report what the tool answered (numbers, paths, dates, failures), not what you expected. Exit 4 is not success. ## Common jobs **Is everything OK?** (health check) `status` → `state` (`idle`, `backing-up`, `busy`, `warning`, `error`), `warnings`, `lastSuccessUtc`, `lastRun`, `incomplete`, `damaged`; then `runs_show` `["last"]` (result, per destination, failed items), `dest_list` (online, `full`, `freeBytes`), `peers_list` (`online`, `reached`, `lastSeenUtc`, `version`), `folders_list` (`lastBackupUtc`, `nextRunUtc`). Summarise: last good run, anything failing, destinations offline or nearly full, folders never backed up. More: [references/health.md](references/health.md). **Back up a folder.** `folders_add` `{"args": [""]}`; options: `frequency` (`once`, `daily` (default), `weekly`, `monthly`, or `hourly`, `every:6` (hours), `daily:02:30`, `manual`, …), `dest` (`all`, `selected:` from `dest_list`, `auto:` = N copies on different PCs), `encrypt` (`on` default when signed in / `off`). Then confirm with `folders_list`. **Run now and wait.** `now` `{"wait": true}` (or `{"args": [""], "wait": true}` for just those files). Exit 0 = fully OK, 4 = finished with warnings (read `runs_show last`), 1 = nothing backed up. A long run: the call stops waiting after `timeoutSeconds` (default 600, up to 3600) but the run goes on; poll `status` (or `status` with `watch` + `until-idle`) and then `runs_show last`. **Find a file in the backups.** `history` (date folders per destination, complete or not), `browse` `{"args": [""], "date": "YYYY-MM-DD"}` (what was in a folder on that date), `explain` `{"args": [""]}` (every copy of one file and why it was or was not copied), `tx` with `path` (a glob) and `since`. **Restore safely.** See [references/restore.md](references/restore.md). In short: 1. `history` / `browse` to pick the date (`latest` = newest complete). 2. `restore` `{"args": [""], "to": "", "date": ""}`; conflicts default to `skip`, `keep-both` keeps both, `overwrite` only when the user asked. 3. Check the answer: files, bytes, `errors` (exit 4 = some failed). Tell the user where the files are. Another PC's backups: `restore` with `pc` and `to` (needs a share or an approved `recover_request`). **Find photos.** `photos_search` `{"args": ["beach 2025"]}` (albums, devices, places, periods, photos), `photos_list` with `search`, `type` (`video`, `selfie`, `screenshot`, …), `from`/`to` dates, `source`; `photos_show` / `photos_details` for one id; `photos_save` `{"args": [ids…], "to": ""}` copies originals out (safe); `photos_restore` puts them back in place (ask first). Albums: `albums_list`, `albums_show`. **What happened?** `runs_list` with `since` (`yesterday`, `7d`), `runs_show` `["last"]` or an id, `events` with `since`, `tx` with `result: "fail"`, `log` with `tail`. Live: `events`/`tx`/`log` with `follow` and `for` (bounded, at most 5 minutes per call). **Destinations and PCs.** `dest_list`, `peers_list`, `dest_add` `{"args": [""]}`; a PC appears as a destination once it runs Space Backup with the same company (`account_status`, `devices_list`). ## When something fails - Exit 3: Space Backup is not running → `start` (then retry). - `status` `warning`/`error`: read `warnings`; `runs_show last` lists failed items and destinations. - A destination offline: its PC is off or unreachable (`peers_list`: `online`, `reached`, `lastSeenUtc`); the backup goes on to the others and catches up when it is back. - Nearly full: `dest_list` `full: true`; suggest another destination or fewer kept versions (`settings_get` `max-backups`), never delete backups yourself. - Not signed in / encryption `waiting`: `account_status`; signing in is the user's step (`account_signin `, then the mailed code with `account_code`). - Still unclear: `diag` `{"out": ".zip"}` makes a support bundle without secrets; the manual is at https://spacebackup.net/manual/ (`help` `{"manual": true, "args": [""]}` gives a topic's address). References: [references/commands.md](references/commands.md) (the commands an agent uses most, with their tool names), [references/restore.md](references/restore.md), [references/health.md](references/health.md), [references/exit-codes.md](references/exit-codes.md). Full CLI reference: https://spacebackup.net/manual/cli/ · MCP setup: https://spacebackup.net/developers/ --- # The commands an agent uses most MCP tool name first, then the command line (`sbctl` on Windows, `spacebackup` on macOS/Linux; add `--json`). **R** = read-only, **W** = changes something easy to take back, **D** = destructive or access-changing: only when the user asked for exactly that. Every command: `help` (or https://spacebackup.net/manual/cli/). ## State and history | Tool | Command | | What | |---|---|---|---| | `status` | `status [--watch --until-idle --for 5m]` | R | state, progress, warnings, last/next run | | `runs_list` | `runs list [--since T] [--folder P] [--limit N]` | R | every run: trigger, times, files, bytes, result | | `runs_show` | `runs show \|last` | R | one run in full: per destination, slowest and failed items | | `events` | `events [--since T] [--follow --for D]` | R | state changes, warnings, peers up/down, runs | | `tx` | `tx [--since T] [--path GLOB] [--result fail] [--kind K] [--limit N]` | R | one record per file operation | | `log` | `log [--tail N] [--follow --for D]` | R | the app log | | `transfers` / `queue` / `stats` | `transfers`, `queue`, `stats [--days N]` | R | moving now, waiting, speeds and errors | | `explain` | `explain ` | R | every copy of one file and why it was or was not copied | | `version` | `version` | R | app and protocol version, running or not | | `start` | `start` | W | start the app/daemon | ## Folders and runs | Tool | Command | | What | |---|---|---|---| | `folders_list` | `folders list` | R | folders, frequency, destinations, last/next run, size | | `folders_add` | `folders add [--frequency F] [--dest D] [--encrypt on\|off] [--plain-dest IDS] [--encrypted-dest IDS] [--keep N\|global]` | W | back up a folder (`plain-dest`: those drives get plain files, ids as in `dest list` separated by `\|`; `keep`: backups kept on each drive) | | `folders_set` | `folders set [--frequency F] [--dest D] [--encrypt on\|off] [--plain-dest IDS] [--encrypted-dest IDS] [--keep N\|global]` | W | change it (`encrypt`: every drive; `plain-dest` / `encrypted-dest`: those drives only; `keep`: its own number of backups on each drive or `global`; fewer: the oldest go at its next backup, the answer says how many) | | `folders_remove` | `folders remove ` | D | stop backing it up (existing backups stay) | | `now` | `now [paths…] [--wait]` | W | back up now (everything, or these paths) | | `cancel` | `cancel [--restore]` | D | cancel the running backup (or the running restores) | Frequency: `once`, `daily`, `weekly`, `monthly`, `monthly:[:HH:mm]`, `hourly`, `every:N` (hours), `daily:HH:mm`, `weekly::HH:mm`, `manual`, `global`. Destinations (`--dest`): `all`, `auto:N` (N copies on distinct PCs and disks), `selected:|` (ids from `dest_list`). Times (`--since`): `YYYY-MM-DD`, `"YYYY-MM-DD HH:mm"`, ISO 8601, `today`, `yesterday`, an age (`2h`, `7d`). Durations (`--for`): `30s`, `5m`, `1h`. ## Destinations, PCs, settings | Tool | Command | | What | |---|---|---|---| | `dest_list` | `dest list` | R | this PC's and the paired PCs' destinations: online, free, full, speed | | `dest_add` | `dest add ` | W | a drive or folder of this PC as a destination | | `dest_remove` / `dest_forget` | `dest remove ` / `dest forget ` | D | remove one (backups on it stay) / forget a gone PC's | | `peers_list` | `peers list` | R | paired PCs: version, address, reachability, last seen | | `settings_get` | `settings get [key]` | R | every setting (keys and values listed) | | `settings_set` | `settings set ` | W | change one | | `scrub` | `scrub [--status] [--now]` | W | integrity check of this PC's destinations | | `update_status` / `update_check` | `update status` / `update check` | R/W | auto-update | | `diag` | `diag [--out FILE.zip]` | W | support bundle without secrets | ## Restore and browse | Tool | Command | | What | |---|---|---|---| | `history` | `history [--folder P] [--dest ID] [--pc NAME]` | R | date folders per destination | | `browse` | `browse [--date D\|latest] [--pc NAME]` | R | what a folder held on a date | | `restore` | `restore [--date D] [--to DIR] [--skip\|--keep-both\|--overwrite] [--pc NAME]` | D | copy a backup back (use `--to` a new folder) | | `recover_list` / `recover_request` | `recover list` / `recover request ` | R/W | restore another PC's backups after approval | | `share_list` | `share list` | R | who may read whose backups | ## Photos and albums | Tool | Command | | What | |---|---|---|---| | `photos_search` | `photos search [--limit N]` | R | albums, devices, places, periods and photos matching | | `photos_list` | `photos list [--search T] [--type T] [--from D] [--to D] [--source K] [--limit N]` | R | photos and videos, newest first | | `photos_show` / `photos_details` | `photos show ` / `photos details ` | R | one item | | `photos_save` | `photos save … --to ` | W | copy originals into a folder | | `photos_restore` | `photos restore … [--to ]` | D | put originals back in place | | `albums_list` / `albums_show` | `albums list` / `albums show ` | R | albums and their items | | `albums_restore` | `albums restore --to ` | W | save a copy of an album | ## Account and company | Tool | Command | | What | |---|---|---|---| | `account_status` | `account status` | R | signed in as, company, role, key, encryption | | `devices_list` | `devices list` | R | the company's PCs | | `account_signin` / `account_code` | `account signin ` / `account code <6 digits>` | W | passwordless sign-in (the user reads the mail) | | `key_fingerprint` | `key fingerprint` | R | the company key's fingerprint (never the key) | | `notifications_list` | `notifications list [--unread]` | R | the app's notifications | --- # Exit codes and results The same on Windows (`sbctl`), macOS and Linux (`spacebackup`), and in the MCP tools' `structuredContent.exitCode`. | Code | Meaning | What to do | |---|---|---| | 0 | OK | Report the result. | | 1 | Error: the command ran and failed (not signed in, not found, refused by the account service, nothing backed up) | Read `error` in the JSON; it says why in plain words. | | 2 | Bad usage: unknown command or option, missing argument, a value of the wrong form, a confirmation option missing (`key clear` without `--force`) | Nothing was done. Fix the call (the message names the problem); never add a confirmation option the user did not ask for. | | 3 | Space Backup is not running | `start` (it waits until the app answers), then retry. | | 4 | Partial: it ran, but some files or destinations failed (`now --wait`, `restore`, `albums restore`, `albums remove-items`, …) | Not success. Read the answer (`errors`, `summary`), then `runs_show last` for a backup. Tell the user what failed. | | 5 | Needs administrator (Windows) or root (Linux) rights (`firewall`, `diag` in some places, `shell install`) | Tell the user; they run it elevated. | | 6 | Not invited yet: `account join` with a personal email (gmail.com, …) and no invitation | An admin of the company invites the email (`account invite` on their PC or the admin page). | | 7 | This computer needs another name: another computer of the company has this PC's name | `settings set machine-name ` (ask the user which name). | ## `now --wait` - 0: the run was fully OK. - 4: the run ended with warnings: a destination missing, a folder not backed up because every destination chosen for it is gone, files skipped, cancelled, or errors after copying something. - 1: nothing was backed up. ## `restore` - 0: every file restored (or skipped because it already existed and no `overwrite`/`keep-both` was given: see `skippedExisting`). - 4: some files failed (`errors`), the others were restored. - 1: nothing found to restore (wrong path or date), or not allowed (another PC's backups not shared with you). ## JSON With `--json` (always on through MCP) every answer is one JSON document: camelCase fields, times in UTC ISO 8601, null fields written. A failure is `{"ok": false, "error": "…"}`. Streams (`--follow`, `status --watch`) are one object per line; through MCP they come back as one JSON array. --- # Checking health A quick, complete check, in this order: 1. `status`: `state` (`idle`, `backing-up`, `busy`, `warning`, `error`), `text`, `warnings` (each a sentence), `lastSuccessUtc`, `nextRun`, `lastRun` (result of the newest run), `incomplete` (destinations with an unfinished date), `damaged` (items the integrity check found broken), `firewallClosed` (other PCs cannot reach this one). 2. `runs_show` `{"args": ["last"]}`: `result` (`ok`, `warning`, `error`, `cancelled`), `summary`, files copied / failed, per-destination results, the slowest and failed items. `runs_list` `{"since": "7d"}` for the week. 3. `folders_list`: every folder's `lastBackupUtc`, `nextRunUtc`, `warning`, `exists` (false: the folder is gone), `incompleteDate`. A folder whose `lastBackupUtc` is null was never backed up. 4. `dest_list`: every destination's `online`, `full` / `freeBytes` / `totalBytes`, `lastCopyUtc`, `status`, `damaged`, `reached` (LAN, direct, relayed). 5. `peers_list`: the paired PCs: `online`, `reached`, `lastSeenUtc`, `version` (very old versions: suggest updating). 6. `scrub` `{"status": true}`: the integrity check (last run, repaired, damaged). 7. `update_status`: current and latest version. 8. `account_status`: `signedIn`, `company`, `encryption` (`ready`, `waiting`, `off`). `waiting` means this PC waits for the company key from another device or an admin. ## How to summarise One short paragraph, then only what needs attention, each with its fix: - "Last good backup: today 02:14 to 3 destinations (OFFICE-PC E:, NAS, laptop). 1 warning." - "OFFICE-PC has been offline since Monday: its copies are 3 days old. Turn it on, or add another destination." - "Drive E: on OFFICE-PC is nearly full (12 GB left)." - "D:\Old Projects no longer exists; its backups are kept. Remove it from the list? (only if you want)." Never fix by deleting: do not remove folders, destinations or backups to make a warning go away unless the user asks. ## Watching a run `status` `{"watch": true, "until-idle": true, "for": "5m"}` returns every change as a JSON array and stops when nothing runs (or after `for`, at most 5 minutes per call). `events` / `tx` / `log` with `follow` and `for` show what happens. `transfers` is what is moving right now, `queue` what waits. --- # Restoring safely Restoring writes files. Done carelessly it replaces the user's current files with older ones. The safe way: ## 1. Find what to restore - `history` (optionally `folder` = the original folder, `dest` = a destination id): date folders per destination, `complete` or not, files, size. - `browse` `{"args": [""], "date": "YYYY-MM-DD"}`: what was directly inside that folder on that date (no `date`: the newest). Walk down folder by folder. - `explain` `{"args": [""]}`: every destination and date holding that file, and why it was or was not copied in the last run. - Photos: `photos_search` / `photos_list`, then `photos_save` (copies originals into a folder you choose; safe). Pick the date with the user ("the version from before Tuesday"). `latest` = the newest complete date. ## 2. Restore into a new folder ``` restore {"args": ["D:\\Projects\\Quote"], "date": "2026-10-28", "to": "D:\\Restored\\Quote-2026-10-28"} spacebackup restore /home/anna/Projects/Quote --date 2026-10-28 --to /home/anna/Restored/Quote-2026-10-28 --json ``` - `args[0]` is the original path (as it was backed up) or a path inside a date folder. - `to`: an empty or new folder. A file keeps its name there; a folder restores its contents into it. - Without `to` the files go back **where they were backed up from** (in place). Do that only when the user asks. - Conflicts: `skip` (default: an existing file is left alone), `keep-both` (`report (restored 2026-10-05).docx`), `overwrite` (replaces the current file: only when the user said so). - Encrypted backups are decrypted on the fly; every file is checked against the date folder's manifest and read back. ## 3. Check and report The answer (`RestoreResultInfo`): `from`, `to`, `date`, `files`, `bytes`, `verified`, `skippedExisting`, `overwritten`, `keptBoth`, `damaged`, `errors`, `cancelled`. Exit 4 = some files failed: list `errors`. Tell the user where the files are and suggest they compare before moving anything back. ## Another computer's backups - `restore` `{"args": [""], "pc": "", "to": ""}`: `to` is required. - Allowed when that PC's backups are shared with the user (`share_list`, "Shared with me") or after an approved `recover_request` `{"args": [""]}` (an owner or admin approves it). Otherwise exit 1 "… are not shared with you". - `history` / `browse` take `pc` too. ## Albums `albums_restore` `{"args": [""], "to": ""}` saves a copy of an album's photos (existing files of the same size are skipped). `albums_guest-restore` does the same for an album of another company you are a guest of. ## Long restores A big restore can take longer than the call waits (`timeoutSeconds`, default 600, at most 3600). When the answer says it stopped waiting, the restore goes on in Space Backup: check `status`, and `cancel` with `restore: true` stops it (only if the user asks; what was restored stays). --- # Space Backup for AI agents: the MCP server Vladimir (2026-10-30): proper Space Backup integration with AI agents. Three parts: 1. **The MCP server** (this page): `sbctl mcp` on Windows, `spacebackup mcp` on Linux and macOS. It ships in the normal install (it is a mode of the command-line program, nothing else to download). 2. **The Agent Skill** (`agent/skill/space-backup/`): how to do the common jobs well and the rules. Downloadable from . 3. **The developer page** , `/llms.txt` and `/llms-full.txt`, the API index `/manual/api/`. Phase 2 (Vladimir, 2026-10-30): **the remote MCP server** on the account service, so cloud agents manage a company without being on a PC: [Remote](#remote) below. ## What it is The [Model Context Protocol](https://modelcontextprotocol.io) lets an AI app (Claude Desktop, Claude Code, Cursor, VS Code, …) call tools of a local program. `sbctl mcp` / `spacebackup mcp` speaks MCP on stdin/stdout (JSON-RPC 2.0, one message per line; protocol versions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05) and offers **every command of [cli.md](cli.md) as a tool**. It talks to the running app/daemon exactly as the command line does (Windows: the tray app's named pipe; Linux and macOS: the daemon's socket), as the user who runs it. Nothing listens on the network. `--profile NAME` (before or after `mcp`) serves a test instance, as everywhere else. ## Setup The program and its path: | Platform | Command | Full path (an app that does not inherit your PATH needs it) | |---|---|---| | Windows | `sbctl mcp` | `%LOCALAPPDATA%\Programs\SpaceBackup\sbctl.exe` | | Linux | `spacebackup mcp` | `~/.local/bin/spacebackup` (user install; a package: `/usr/bin/spacebackup`) | | macOS | `spacebackup mcp` | `/Applications/Space Backup.app/Contents/MacOS/spacebackup` | **Claude Code** (one line, per user): ```sh claude mcp add --scope user space-backup -- spacebackup mcp # Linux, macOS (use the full path if not on PATH) claude mcp add --scope user space-backup -- sbctl mcp # Windows ``` **Claude Desktop**: Settings → Developer → Edit Config (`claude_desktop_config.json`), then restart Claude Desktop: ```json { "mcpServers": { "space-backup": { "command": "C:\\Users\\YOU\\AppData\\Local\\Programs\\SpaceBackup\\sbctl.exe", "args": ["mcp"] } } } ``` (macOS: `"command": "/Applications/Space Backup.app/Contents/MacOS/spacebackup"`; Linux: `"/home/YOU/.local/bin/spacebackup"`.) **Cursor**: `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project): ```json { "mcpServers": { "space-backup": { "command": "spacebackup", "args": ["mcp"] } } } ``` **VS Code** (GitHub Copilot agent mode): `.vscode/mcp.json` in a workspace, or the user configuration (command palette: *MCP: Open User Configuration*): ```json { "servers": { "space-backup": { "type": "stdio", "command": "sbctl", "args": ["mcp"] } } } ``` Any other MCP client: a stdio server, command `sbctl` / `spacebackup`, argument `mcp`. Check it by hand: `printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | spacebackup mcp` prints two lines of JSON (stderr has one line saying it is serving). ## The tools Generated from the command table (`Commands.All` in `src/SpaceBackup.Control/Commands.cs`), never listed by hand (`src/SpaceBackup.Control/Mcp.cs`, `McpTools`): - **Name**: the command with `_` for the space: `status`, `folders_add`, `runs_show`, `photos_search`, `account_members`; a hyphen stays (`account_auto-join`, `vision_delete-models`). - **Description**: the command's help, its command line (`spacebackup folders add [--frequency F] …`) and the exit codes. - **Input schema**: `args`, the positional arguments in order (an array of strings, with the command's minimum and maximum count), and one property per option, named as the option without `--`: a flag is a boolean (`"wait": true`), a number an integer, a repeatable option an array, anything else a string. Unknown properties are refused. `timeoutSeconds` (every tool): how long the call waits for its answer (below). Example: `folders_add` with `{"args": ["/home/me/Projects"], "frequency": "weekly", "dest": "auto:2"}` is `spacebackup folders add /home/me/Projects --frequency weekly --dest auto:2`. - **Result**: the command's `--json` document as text, and as `structuredContent` `{"exitCode": N, "ok": true|false, "result": }`. `isError` is true for exit codes other than 0 and 4 (4 = partial: some items or destinations failed; the document says which). The text of a failure ends with `(exit code N: meaning)`. Exit 3 means the app is not running: the `start` tool starts it. - **Paths**: give them absolute. A relative path is resolved against the folder the AI app started the server in. ### Annotations Every command is classified in `McpTools` as one of: - **read-only** (`readOnlyHint`: true): `status`, the `list`/`show`/`get`/`status` commands, `history`, `browse`, `explain`, `tx`, `runs`, `events`, `log`, `stats`, `search`, `photos_search`, `key_fingerprint`, `help`, … - **destructive** (`destructiveHint`: true, so the client asks the user before calling it): anything that deletes, removes, forgets, overwrites, stops or interrupts, changes keys or who may read what, or publishes: `folders_remove`, `dest_remove`, `dest_forget`, `key_set`, `key_generate`, `key_clear`, `restore` (it may write over files), `photos_restore`, `photos_delete`, `albums_delete`, `account_members`, `account_groups`, `devices_remove`, `devices_approve`, `approvals_approve`/`_deny`, `share_add`/`_remove`, `albums_share`, the public links, `stop`, `restart`, `cancel`, `update_now`, `account_signout`, and the secret tools `key_show` and `photos_open` (see Secrets), … - **write** (neither): the rest, changes that are easy to take back (`folders_add`, `now`, `settings_set`, `dest_add`, `albums_create`, …). `openWorldHint` is true for the commands that reach the account service, Google, the relay or the update feed. **The parity test.** `McpTests.Every_command_is_a_tool_with_a_classified_effect` (tests/SpaceBackup.Control.Tests) fails naming every command that is not classified, so a new command cannot ship without its tool (and with the UI parity test, a new button cannot ship without both). `Annotations_mark_reading_and_destroying` checks that every `… remove|delete|forget|clear|unshare|unlink|signout|uninstall` command is destructive. The commands that manage the program itself (`spacebackup daemon`, `install`, `uninstall`, `integrate`, `gui`; the Windows installer) are not part of the command table and have no tools. ### Asking first The command line never prompts; a confirmation is the command's own option. The tools keep that: `key_clear` without `force` and `folders_remove` without its path are refused (exit 2); `photos_delete`, `vision_download` and `vision_delete-models` without `confirm` only say what they would do. None of them changes anything. The server's `instructions` (sent at initialize) and the Agent Skill tell the model never to call a destructive tool unless the user asked for exactly that. ### Streams and long calls - `--follow` (`log`, `tx`, `events`, `vision_download-progress`), `status` with `watch`, and `notifications_watch` are **bounded calls**: the call runs for `for` (default 30 s, at most 5 minutes) and answers every line as one JSON array (the newest 500). To keep watching, call again (with `after`, the cursor, where the command has it). - Every call waits at most `timeoutSeconds`: default 120 s; 600 s for the commands that wait (`now`, `gdrive_now`, `icloud_now` with `wait`, `restore`, `albums_restore`, `photos_restore`, `photos_save`, `update_now`, `diag`, `gdrive_add`, `vision_install`, `vision_test`); at most 3600. When the time is up the answer says so (`structuredContent.timedOut`: true, not an error): what the command started goes on in Space Backup; check it with `status` or `runs_show` `["last"]`. - `gdrive_add` prints the Google sign-in address first and then waits for the sign-in; with a short `timeoutSeconds` the answer holds the address so the user can open it. - An MCP `notifications/cancelled` stops waiting for that call. ### Secrets - The server never logs a call's arguments: its stderr gets one line per call, the tool's name and exit code (`mcp: key_set exit 0`). The app/daemon logs commands without secrets, as for the command line (`key set`, `settings set relay-token`, `photos close-page`). - `key_set` and `settings_set relay-token` take the secret as an argument, so it would pass through the conversation and the AI app's history: prefer their `file` property (a file holding the secret on its first line). Reading from stdin (`-`) is not available over MCP (stdin is the protocol). - **Key material is hidden in every answer.** A tool's answer (its text and `structuredContent`) goes into the AI app's conversation and its provider's transcript, so `McpTools.Redact` replaces the value of every key-material field, at any depth and in any case, with `[hidden]`: `companyKey` (status), `secret` (photos open), `token`, `accessToken`, `refreshToken`, `relayToken`, `password`, `passphrase`, `recoveryKey`, `accountProof`, `apiKey`, `privateKey`, `masterKey`, `dataKey`, and `key` in the `key_*` tools' answers. Every other place such a value appears (an address that carries the secret) gets `[hidden]` too. Only the MCP answer changes: the command line and its `--json` print what they always did. (status's `companyKey` holds the key's fingerprint on Windows and Linux today; it is hidden anyway, `key_fingerprint` gives the fingerprint.) - **The secret tools** print key material by design: `key_show` (the company key) and `photos_open` (the viewer's address with its session secret; with `app`, a secret that may run every command). They are destructive, their schema requires `reveal`, which must be the command's own name (`"key show"`, `"photos open"`), and a call without it is refused (exit 2) before anything reaches the app. The model gives `reveal` only when the user asked for exactly that by name; the answer then holds the secret, unredacted. Their descriptions say never to repeat it elsewhere. - What reaches the conversation otherwise: `settings_get` shows secret settings as set / not set; `diag` writes a bundle without the company key and relay token; the account's own pages never had keys. The remote MCP (below) answers nothing an app would not show (no keys, no sealed blobs). ## Tests - `tests/SpaceBackup.Control.Tests/McpTests.cs` (both platforms, in-process with the fake target): every command is a tool and classified, schemas and annotations, initialize/ping/unknown method, a read call, destructive calls refused without their arguments (nothing reaches the app), arguments → command line, bounded streams, a secret not logged, key material hidden (`companyKey` = `[hidden]`, `key_show`/`photos_open` refused without `reveal`, a secret hidden where it appears in an address), not running = exit 3, `mcp` on the command line. - `tests/mcp-e2e.py`: an MCP client over stdio against a real Space Backup: Linux starts a test daemon (own profile, XDG folders and port) and runs `spacebackup --profile P mcp`; Windows starts the tray with `sbctl --profile P start` and runs `sbctl --profile P mcp` (`python tests\mcp-e2e.py publish\sbctl.exe`). It checks initialize, tools/list (every command of `help` is a tool), status and version, `folders_remove`/`key_clear` refused without their arguments, `dest_add` + `folders_add` + `now` with `wait` + `runs_show last` + `restore` to a new folder, `log` with `follow` bounded, and that the server's log has no secret. **Key material parity:** it sets a known company key, checks the plain CLI is unchanged (`key show` prints it, `--json status` has `companyKey`), that `key_show` and `photos_open` are refused without `reveal` and answer with it, then calls every read-only tool that needs no arguments and fails naming any tool whose answer (of the whole run, except the two asked with `reveal`) holds the key or the viewer's secret. Ends with `MCP E2E PASSED`. ## Implementation notes - `CliRunner.Run` sees `mcp` before parsing and runs `McpServer` on the program's stdin/stdout. Console output from anything else goes to stderr while it serves, so it cannot break the protocol. - A call builds the command line from the arguments (`McpTools.CommandLine`) and runs `CliRunner.Run` with `--json` and a host that has no stdin and is never interactive. So the tools parse, validate and answer exactly as the command line does, and the local commands (`start`, `stop`, `version`, `firewall`, …) work too. - Calls run concurrently; answers are written one line at a time under a lock. - JSON text is written with `Utf8JsonWriter` (the trimmed single-file builds have no reflection resolver for `JsonNode.ToJsonString(options)`). ## Remote `https://spacebackup.net/account/mcp`: an MCP server on the account service for agents that run in the cloud (Claude, ChatGPT-style connectors, hosted agents) or anywhere without Space Backup installed. The agent signs in with the user's **Space Backup account** (OAuth 2.1, the same email link or code as the website) and then acts as that member, with that member's role (owner, admin or member): the same rules as the apps and the account pages, nothing more. ### Connect The URL is all a client needs; it finds the sign-in itself (below). - **Claude (claude.ai, Claude Desktop, mobile):** Settings → Connectors → *Add custom connector* → URL `https://spacebackup.net/account/mcp` → Connect. A browser opens the Space Backup sign-in. - **Claude Code:** `claude mcp add --transport http space-backup https://spacebackup.net/account/mcp`, then `/mcp` → space-backup → Authenticate. - **Cursor:** `~/.cursor/mcp.json`: `{ "mcpServers": { "space-backup": { "url": "https://spacebackup.net/account/mcp" } } }`. - **VS Code:** `.vscode/mcp.json`: `{ "servers": { "space-backup": { "type": "http", "url": "https://spacebackup.net/account/mcp" } } }`. - **Any client** with MCP authorization (Streamable HTTP + OAuth 2.1 with dynamic client registration or a client id metadata document). The sign-in: a browser opens `/account/oauth/authorize`; signed out, the usual email sign-in (link or 6-digit code), then **Allow ?** with three buttons: **Allow** (read and change), **Allow reading only**, **Deny**. The member sees and disconnects their agents on `/account/me` under **AI agents**. ### What it can do 35 tools on the account service's own methods (the same checks and errors as the API): | Read (readOnlyHint) | Change (destructiveHint) | |---|---| | `whoami`, `company_get`, `devices_list`, `device_status`, `members_list`, `groups_list`, `albums_list`, `album_get`, `albums_deleted`, `shares_list`, `relay_balance`, `notifications_list`, `audit_log`, `backup_request_get` | `backup_now`, `members_invite`, `members_set_role`, `members_approve`, `members_deny`, `members_remove`, `groups_create`, `groups_update`, `groups_delete`, `albums_create`, `albums_update`, `albums_delete`, `albums_put_back`, `albums_delete_permanently`, `albums_share`, `albums_unshare`, `shares_create`, `shares_remove`, `devices_label`, `devices_remove`, `company_update` | - Every change is marked `destructiveHint` (so the AI app asks the user first); `idempotentHint` where repeating it changes nothing more. Owner/admin tools answer a member "only the company's owner or an admin may do this". - Devices, members, albums and groups may be given by id or by name (machine name, label, email, album or group name); an ambiguous name answers with the ids to choose from. - `device_status`: the device row (last seen, version), a PC's own report (running now, last backup's start, end, result, error line, files and bytes, next run, folder and destination counts; sent by PCs on 0.16.23 or later), when a phone last saved its backup state, and the newest backup requests. - `backup_now {device, wait_seconds?}`: asks a PC or Mac to run its backup, as **Back up now** there. The request waits until the PC's next account sync (about a minute; the PC must be on and on 0.16.23 or later), which runs it and answers `started` (or `failed` with the reason), then `done`/`failed` when that run ends. `wait_seconds` (up to 90) waits for the start; `backup_request_get` follows it. Not picked up within an hour: `expired`. One open request per PC. Its member or an owner/admin. Phones back up from their own app (refused here). - Never available: data keys, the company key, sealed blobs, file names inside backups, file contents, photos. The service does not have them (end-to-end encrypted on the PCs). ### Limits and audit - Per connection 60 calls a minute and 1000 an hour; per member 120 changes an hour. Over a limit the tool answers an error ("Rate limit: …"), nothing is done. - Every `tools/call` writes one row to the company's audit log (the admin page's **Audit log**, and `audit_log`): kind `mcp`, the member, the tool, `": → ok | error 403: … | refused: read-only connection | refused: rate limit"`. Disconnecting an agent writes one too. - A read-only connection (scope `read`) answers every change with "This connection may only read" before it runs. ### Protocol - **MCP:** `POST /account/mcp`, Streamable HTTP without sessions: each POST is one JSON-RPC message (or a batch), answered `application/json` (no `Mcp-Session-Id`, no SSE stream; `GET`/`DELETE` → 405). Notifications → 202. Protocol versions 2025-11-25, 2025-06-18, 2025-03-26 (an unknown `MCP-Protocol-Version` header → 400). Results carry `structuredContent` (an object) and the same JSON as text. CORS is open (bearer tokens, no cookies). - **No token / bad token:** 401 with `WWW-Authenticate: Bearer resource_metadata="https://spacebackup.net/.well-known/oauth-protected-resource/account/mcp", scope="read write"` (plus `error="invalid_token"` for an unknown, expired or revoked one). - **Discovery:** protected resource metadata (RFC 9728) at `/.well-known/oauth-protected-resource/account/mcp` (also `/.well-known/oauth-protected-resource` and `/account/.well-known/oauth-protected-resource`): resource `https://spacebackup.net/account/mcp`, authorization server `https://spacebackup.net/account`. Authorization server metadata (RFC 8414) at `/.well-known/oauth-authorization-server/account` (also at the root and under `/account/.well-known/`). - **Clients:** dynamic registration (RFC 7591) at `POST /account/oauth/register` (public clients with `token_endpoint_auth_method` `none`, or a client secret for `client_secret_post`/`client_secret_basic`; 20 registrations an hour per address), or a client id that is the https URL of a client metadata document (fetched with no redirects, 64 KB, only from public addresses, kept a day). Redirect URIs: https, http to localhost/127.0.0.1 (any port, RFC 8252), or an app's own scheme (`cursor://`, `vscode://`); never `javascript:`, `data:`, `file:`. - **Authorize:** `GET /account/oauth/authorize` with `response_type=code`, PKCE `code_challenge` + `S256` (required), `state`, `scope` (`read`, `write`; none = both), `resource` (`https://spacebackup.net/account/mcp`). An unknown client or an unregistered redirect URI is shown on the page and never redirected to. The answer carries `code`, `state` and `iss`. The consent page cannot be framed. - **Token:** `POST /account/oauth/token` (form): `authorization_code` with `code_verifier`, or `refresh_token`. Access tokens (`sba_…`) live an hour; refresh tokens (`sbr_…`) 30 days and are replaced at each use (the old one stops working); a refresh may narrow the scope, never widen it. A code works once and for 10 minutes; used twice, the grant it gave is revoked. **Revoke:** `POST /account/oauth/revoke` (RFC 7009) ends the whole grant. - Tokens are kept as SHA-256 hashes, apart from the apps' sessions: an MCP token opens nothing under `/account/api`. ### Implementation (service) - `src/SpaceAccount/OAuth.cs` (clients, codes, grants, tokens; tables `oauth_clients`, `oauth_codes`, `oauth_grants`, `oauth_tokens`), `WebOAuth.cs` (the authorize and consent pages, token/register/revoke, the AI agents panel), `RemoteMcp.cs` (the endpoint, the tools, discovery, CORS, rate limits, the audit row), `DeviceCommands.cs` (`device_commands`, `device_status`; [chapter 9 "Remote commands & PC status"](manual/09-api-account.md#api-remote)). - The PCs' side (`src/SpaceBackup/RemoteCommands.cs`, `IdentityService.CommandReceived`/`StatusProvider`): each minute's sync may list `commands`; the PC acts on each id once (`backup-now` = the control command `now`, queued behind a running backup; any other kind is answered `failed / unknown command`), answers `POST devices/commands/{id}` (started or failed at once, then done or failed when that run ends) and sends an answer that did not arrive again when the command is listed again. It reports `PUT devices/status` when it changes, at least every 15 minutes and just after a run; a ≤200-character error line with paths taken out; never file names, folder paths or keys. An older service's 404: answers count as delivered, the status is not sent again until the app restarts. - Tests: `tests/SpaceAccount.Tests/RemoteMcpTests.cs` (discovery; registration, consent and PKCE through the real pages; roles; read-only; backup-now through a PC's sync with its answer, status and expiry; single-use codes and refresh tokens; disconnect and RFC 7009; bad redirects and clients; a metadata-document client; the rate limit; nothing secret in what the read tools answer) and `tests/SpaceBackup.Tests/RemoteCommandIdentityTests.cs` (the PC). - `tests/remote-mcp-e2e.sh [python]`: the official MCP Python SDK (2.x) against a fresh local spaceaccount with mail to files: discovery, dynamic registration, the real sign-in pages with the mailed code, consent, PKCE, initialize, tools/list (annotations), whoami, devices_list, backup_now answered by a PC through its sync, device_status, a tool error, audit_log, refresh token. Ends with `REMOTE MCP SDK E2E PASSED` (passed 2026-10-30 on the deployed build). Against production, the SDK was run up to the sign-in page (no mailbox there). - Deploy: the service binary as usual (deploy/README.md), plus nginx `location ^~ /.well-known/oauth- { proxy_pass http://127.0.0.1:5080; … }` in the spacebackup.net server block (the discovery documents live at the site's root). --- # Command line reference Every button, menu item and setting of Space Backup also exists as a command, with the same names, options, output and exit codes on Windows, macOS and Linux, so a person, a script or an AI agent can run Space Backup entirely from a terminal. This chapter lists every command with its arguments, exit codes, JSON fields and an example. ## Which program, and how it works {#intro} The command line is a separate small program that talks to the running Space Backup app on the same computer. It does not do the work itself: it sends the request to the app, waits for the answer and prints it. | Platform | Program | Where it is | Talks to | |---|---|---|---| | Windows | `sbctl` (`sbctl.exe`) | next to `SpaceBackup.exe` in `%LOCALAPPDATA%\Programs\SpaceBackup`. The app adds this folder to your user `PATH` when it starts, so a new PowerShell or Command Prompt window finds `sbctl` | the tray app, over a named pipe that only your Windows user can open | | macOS | `spacebackup` | inside the app: `Space Backup.app/Contents/MacOS/spacebackup` (for an app in Applications: `/Applications/Space Backup.app/Contents/MacOS/spacebackup`) | the Space Backup daemon behind the menu-bar app, over `~/Library/Application Support/SpaceBackup/control.sock` | | Linux | `spacebackup` | `/usr/bin/spacebackup` (.deb), `~/.local/bin/spacebackup` (.tar.gz), or the AppImage file itself (run it with a command) | the daemon (the `spacebackup.service` systemd user service), over the Unix socket `$XDG_RUNTIME_DIR/spacebackup.sock` that only your user can open | On Linux and macOS the same `spacebackup` file is both the command line and the daemon (`spacebackup daemon`). On Windows `sbctl.exe` is a console program next to the tray app, so that its output works in PowerShell and `cmd` pipes. In this chapter a command is written without the program name: `status` means `sbctl status` on Windows and `spacebackup status` on macOS and Linux. Examples show one or the other; they work the same on every platform unless a section says otherwise. ```powershell PS C:\> sbctl status idle: All good; last backup 2026-10-18 02:31 last success: 2026-10-18 02:31; next run: 2026-10-19 02:14 last run: ok 2026-10-18 02:31: 214 new, 12 changed, 12194 unchanged (linked), 1240.5 MB machine: ANNA-PC, port 47800, company key 3F9A-C2D1, version 0.12.1 Space Relay: Not needed: all PCs are on this network ``` Things that hold for every command: - **The app must be running.** If it is not, a command that needs it prints `Space Backup is not running (start it: sbctl start)` and exits with code 3. `start` launches it; `version`, `help`, `start`, `stop`, `restart`, `shell` and `firewall` (except `firewall --check` on Windows) work without it: the command line runs them itself. - **The command line never asks a question.** Whatever a window would ask (a confirmation, a choice) is the command itself or one of its options (`--frequency`, `--dest`, `--encrypt`, `--overwrite` / `--keep-both` / `--skip`, `--take-over`, `--restart-explorer`, `--force`, …). `--yes` (`-y`) is accepted anywhere for scripts that like to say it, and changes nothing. The only exception is `account signin` typed at a terminal, which waits for the code from the mail (see [account signin](#account-signin)). - **Paths are made absolute.** A relative path is taken relative to the folder you are in (`folders add .` adds the current folder). Paths given with `restore --pc` and `browse --pc` are left exactly as typed, because they are paths on another computer. - **Same everywhere.** The command table, the argument checks, the JSON shapes and the texts are one shared piece of code used by the Windows app, the macOS daemon and the Linux daemon. The Linux graphical app and the Mac menu-bar app send these same commands. - **Everything the windows can do has a command.** This is checked automatically before every release: a button or setting without a command cannot ship. > **Note:** On Windows, a new `sbctl` and an older `SpaceBackup.exe` (or the other way round) may not understand each other. Both come from the same release and are updated together; if you see `is SpaceBackup.exe older than sbctl.exe?`, let the update finish or reinstall. ## AI agents (MCP) {#mcp} An AI app (Claude Desktop, Claude Code, Cursor, VS Code and other Model Context Protocol clients) can use Space Backup directly: `sbctl mcp` on Windows and `spacebackup mcp` on macOS and Linux run a local MCP server that offers **every command of this chapter as a tool**. It comes with the normal install (version 0.16.23 or later) and talks to the running app like the command line does; nothing listens on the network. - A tool is named after its command, with `_` for the space: `status`, `folders_add`, `runs_show`, `photos_search` (a hyphen stays: `account_auto-join`). Its arguments are `args` (the positional arguments, in order) and one property per option, named without `--` (`{"args": ["D:\\Projects"], "frequency": "weekly"}`); a flag is `true`. The answer is the command's `--json` document and its exit code. - Tools that delete, remove, overwrite, stop, or change keys or who can read what are marked **destructive**, so the AI app asks you before it calls one. Read-only tools (`status`, the `list` and `show` commands, `history`, `browse`, `explain`, …) are marked as such. - `--follow` and `--watch` run for a bounded time per call (30 seconds by default, at most 5 minutes). A call waits at most 2 minutes for its answer (10 minutes for `now --wait`, `restore` and the other waiting commands; `timeoutSeconds` up to an hour); a backup or restore it started goes on after that. - The server never logs a call's arguments. Prefer `key set --file` for the company key, so the key does not pass through the conversation. To connect Claude Code, run `claude mcp add --scope user space-backup -- sbctl mcp` (Windows) or `claude mcp add --scope user space-backup -- spacebackup mcp` (macOS, Linux). The lines for Claude Desktop, Cursor and VS Code, the **Space Backup agent skill** (how an agent does the common jobs well, and its rules) and the API specifications are on the page [For developers & AI agents](https://spacebackup.net/developers/). **Agents in the cloud** (no Space Backup on their computer) connect to your account instead: the remote MCP server `https://spacebackup.net/account/mcp`. The AI app opens the Space Backup sign-in, you allow it (or allow reading only), and it manages the company as you, with your role: devices and their last backup, members and invitations, groups, albums, shares, the relay balance, and **back up now** on a PC. It never sees files, photos or keys; every call is in the company's audit log, and **AI agents** on your account page disconnects it. Setup for Claude, Claude Code, Cursor and VS Code: [For developers & AI agents](https://spacebackup.net/developers/#remote). ## Global flags and JSON {#global-flags} These flags may stand anywhere on the command line, before or after the command. | Flag | What it does | |---|---| | `--json` | Machine-readable output: one JSON document per command, on one line. Streams (`--follow`, `status --watch`, `notifications watch`) print one JSON object per line. | | `--quiet`, `-q` | No text on success. Errors are still printed (to stderr), and the exit code still tells what happened. | | `--profile ` | Talk to a separate instance with its own settings and state (a short name: letters, digits, `-` or `_`, up to 20 characters). Used for tests; such an instance listens on 127.0.0.1 only and calls itself `-`. | | `--yes`, `-y` | Accepted, changes nothing (the command line never asks). | | `--help`, `-h`, `-?`, `/?` | The same as `help`: all commands, or with a command, its options. | Options of a command are written `--name value` or `--name=value`. An option given twice is an error (exit 2), except the few that may repeat: `tx --kind`, `photos list --source`, `albums clone --id` and `albums import --dest`. A flag (an option without a value) refuses a value (`--wait=yes` is an error). ### JSON output {#json} With `--json`: - Field names are camelCase (`lastBackupUtc`, `sizeBytes`). Times are UTC in ISO 8601 (`2026-10-18T06:14:03Z`). A field that has no value is written as `null`, so every field is always there (the only exceptions: `firewall`'s `kind` and `allowCommand`, which are left out when empty). - Fields are only ever added in new versions, never renamed or removed, so a script written today keeps working. - A command that changes something answers with a **command result**: `{"ok":true,"partial":false,"message":"…","error":null}`. `partial` is `true` when it was done only in part (exit 4). - A failure is a command result with `ok: false` and the reason in `error`, printed on **stdout** (so a script reads one place), plus the exit code. ```sh $ spacebackup --json folders remove /home/anna/Old {"ok":false,"partial":false,"message":null,"error":"Not in Space Backup: /home/anna/Old (spacebackup folders add)"} $ echo $? 1 ``` Without `--json`, a successful answer (exit 0, and also exit 4) is printed on stdout; an error goes to stderr as `sbctl: ` on Windows or `spacebackup: ` on macOS and Linux. ### Watching and following {#streams} Some commands can keep printing. The command line asks the app again every second (every 2 seconds for `status --watch`), and passes on what is new. | Command | Keeps printing | Stops | |---|---|---| | `status --watch` | the status, each time it changes | `--until-idle` (once nothing is running), `--for `, or Ctrl+C | | `tx --follow`, `events --follow`, `log --follow` | each new record, event or log line | `--for ` or Ctrl+C | | `notifications watch` | each new notification | `--for ` or Ctrl+C | Ctrl+C ends a stream with exit code 0. With `--json`, each item is one JSON object on its own line, so a program can read them one by one as they come. > **Note:** `tx`, `events`, `log` and `notifications watch` also accept `--after `, a cursor (the `cursor` or `seq` of the previous answer). The command line uses it while following; you only need it to page by hand. `notifications watch` also takes `--wait ` (at most 25) and `--unread `: the answer waits until something changes. ## Exit codes {#exit-codes} The exit code every `sbctl` (and `spacebackup`) command returns; the same numbers on every platform. | Code | Meaning | Typical commands | |---|---|---| | `0` | OK. | all | | `1` | Error: it did not happen. The message says why. | all | | `2` | Bad usage: an unknown command or option, a missing or malformed argument. Nothing was sent to the app. | all | | `3` | Space Backup is not running (start it with `start`). | every command that needs the app | | `4` | Partial: done, but not fully (some files, destinations or computers failed; a backup ended with warnings; a restore was stopped). | `now --wait`, `restore`, `albums add`/`remove`/`clone`/`caption`/`restore`/`delete`, `photos save`/`restore`/`new-album`, `gdrive now`, `cancel --restore` | | `5` | Needs administrator (Windows) or root (Linux) rights. | `firewall` on Windows; `firewall --allow` on Linux when `sudo` would ask for a password | | `6` | Not invited yet: you signed in with a personal email (gmail.com, outlook.com, …) and nobody has invited it to a company. | `account join` | | `7` | This computer needs another name: another computer of your company already has its name, or the name cannot be used. `settings set machine-name ` answers it. | `account join`, `account code` | What exit 4 means for the commands that use it: - `now --wait`: 0 when the run was OK; 4 when it ended with warnings (a destination missing, a folder not backed up because every destination chosen for it is gone, files skipped, cancelled) or with errors after copying something; 1 when nothing was backed up. - `restore`, `albums restore`, `albums guest-restore`, `photos save`, `photos restore`: 4 when some files failed and others were restored or saved; 1 when none were. - `albums add`, `albums clone`, `albums remove` (by a member): 4 when some items went and others did not; 1 when none did. - `cancel --restore`: each stopped restore ends with `cancelled: true` and exit 4. ## Values: frequencies, destinations, times {#values} Several options take the same kinds of values; they are checked by the command line before anything is sent. ### Frequency {#frequency} How often a folder (`folders add|set --frequency`), the whole computer (`settings set frequency`) or a Google account (`gdrive set frequency`) is backed up. The *night window* is the time range in which scheduled backups run (`settings set night-window`, default from the Settings window); each computer and folder starts at its own fixed time in it. | Value | Meaning | Folders | Global `frequency` | Google accounts | |---|---|---|---|---| | `daily` (also `night`) | every night in the night window. `folders list` prints it as `night`. | yes (default) | yes | yes (`night`) | | `weekly` | once a week in the night window, on the weekday of the folder's first backup | yes | no | no | | `monthly` | once a month in the night window, on the day of the month of its first backup (29–31 become the last day of shorter months) | yes | no | no | | `once` | one backup at the next night window, then only on demand; listed as "backed up once on " | yes | no | no | | `monthly:` | that day of the month (1–31), in the night window | yes | no | no | | `monthly::HH:mm` | that day of the month at that time | yes | no | no | | `hourly` | every hour | yes | yes | yes | | `every:N` | every N hours (1–24) | yes | yes | yes | | `daily:HH:mm` | every day at that time | yes | yes | yes | | `weekly::HH:mm` | one weekday (`mon` … `sun`) at that time | yes | yes | yes | | `manual` | never on a schedule, only with `now` | yes | yes | yes | | `global` | follow the global frequency | yes | no | no | The add dialogs only offer **Only once**, **Daily**, **Weekly** and **Monthly**; the other forms are for the command line. `folders list --json` gives the dialog's choice in `choice` (`once`, `daily`, `weekly`, `monthly`, or `null` for an advanced form or `global`). > **Note:** `max-backups` counts date folders, but the newest complete backup of each folder in the list is never removed from a destination, because a weekly, monthly or once folder is not in every date folder. A `once` folder's backup stays until the folder is removed from the list. A folder can keep its own number of backups (`folders set --keep N`); see [How many backups are kept](03-backing-up.md#keeping-backups). ### Destinations {#dest-values} Which destinations a folder (`folders add|set --dest`) or a Google account (`gdrive add --dest`, `gdrive set dest`) goes to. | Value | Meaning | |---|---| | `all` | every destination (the default) | | `auto:N` | N copies (1–99), on different computers and different physical disks where possible | | `selected:\|…` | exactly these destinations: ids as `dest list` prints them (`OFFICE-NAS:/srv/backup`), or a local path or backup root of this computer. Put the value in quotes in a shell, because of the `\|`. | ### Times and durations {#times} - **Times** (`--since`, `--until`): `YYYY-MM-DD`, `"YYYY-MM-DD HH:mm"`, ISO 8601 (`2026-10-18T08:00:00Z`; without a zone it is local time), `today`, `yesterday`, `now`, or an age: `30m`, `2h`, `7d`, `1w` (that long ago). - **Durations** (`--for`, `--interval`): a number with `s`, `m`, `h`, `d` or `w`: `90s`, `5m`, `1h`. A bare number is seconds. - **Dates** (`--date`, `--from`, `--to` of `photos list`): `YYYY-MM-DD`. Where `latest` is allowed, it means the newest backup. ## Short forms {#short-forms} A group name alone runs its listing: | Short form | Same as | |---|---| | `folders` (also `folder`) | `folders list` | | `dest` (also `destinations`, `dests`) | `dest list` | | `peers` | `peers list` | | `settings` | `settings get` (and `settings ` = `settings get `) | | `key` | `key fingerprint` | | `runs` | `runs list` | | `update` | `update status` | | `shell` | `shell status` | | `gdrive` | `gdrive list` | | `account` | `account status` | | `devices` | `devices list` | | `recover` | `recover list` | | `share` | `share list` | | `albums` | `albums list` | | `relay` | `relay balance` | | `photos` | `photos list` | | `notifications` | `notifications list` | ## Status and control {#status-control} ### status ``` status [--watch [--interval 2s] [--until-idle] [--for 5m]] ``` What Space Backup is doing now: the state, progress, the current item, the last and next run, warnings, the computer's name and port, the company key's fingerprint, Space Relay and updates. The same as the tray icon's tooltip and the **Status…** window. | Option | Meaning | |---|---| | `--watch` | print the status again each time it changes (with a `--- HH:mm:ss` line before each one) | | `--interval ` | with `--watch`: how often to ask (default `2s`, at least 0.2 s) | | `--until-idle` | with `--watch`: stop as soon as nothing is running (state other than `backing-up` or `busy`) | | `--for ` | with `--watch`: stop after that long | `state` is one of `idle`, `backing-up`, `busy` (a check, a fan-out copy or another job), `warning` or `error`. JSON fields (`--json`): `state`, `text`, `progress` (percent or null), `bytesDone`, `bytesTotal`, `scanning`, `currentItem`, `lastSuccessUtc`, `nextRun`, `machine`, `port`, `loopbackOnly`, `companyKey` (fingerprint), `fanOutBacklog` (`files`, `bytes`: copies still to be passed on to other destinations), `incomplete` (list of `destination`, `date`: date folders not finished), `damaged` (files found damaged), `lastRun` (`state`, `summary`, `startedUtc`, `finishedUtc`), `relay` (`address`, `state`, `problem`, `text`, `publicIp`, `rttMs`, `usedBytesThisMonth`, `quotaBytes`, `mappedPort`, `bytesOut`, `bytesIn`, `enabled`, `status`, `activationNeeded`, `activateUrl`, `groupCode`), `warnings` (plain sentences), `firewallClosed` (Linux: the firewall does not let other computers in yet), `version`, `updatedFrom` (once after an update), `updateAvailable`, `outOfDate` (this computer runs an older version than the update feed or another computer: `running 0.16.79; 0.16.82 is in the update feed and on CHIA2; update: …`, the update's own words on why it has not installed yet; null when up to date), `vision` (the photo analysis self-check, on a computer that runs it: `ok, worker idle 3 min`, or `STALLED since …` when photos or videos wait while a computer that could do them stands idle; a health check can look for `STALLED`). The text has an `out of date:` line and a `vision:` line for them (`vision: STALLED since 2026-11-03 14:05 (20 min): 23 item(s) wait here (photoFaces 14, videoFaces 9), DST-AI-3090, mars-001 idle: offered nothing; assignment retried 1 time(s)`). `peers` adds `(out of date)` after a computer's version when it is older than the newest one known. Example: wait in a script until the running backup is over. ```sh $ spacebackup --json status --watch --until-idle {"state":"backing-up","text":"Backing up… 42% (1.20 GB of 2.86 GB)","progress":42,"bytesDone":1288490188,"bytesTotal":3067834368,"scanning":false,"currentItem":"/home/anna/Documents/Reports/q3.xlsx","lastSuccessUtc":"2026-10-17T06:14:03Z","nextRun":"2026-10-19T06:14:00Z","machine":"ANNA-LAPTOP","port":47800,"loopbackOnly":false,"companyKey":"3F9A-C2D1","fanOutBacklog":{"files":0,"bytes":0},"incomplete":[{"destination":"OFFICE-NAS:/srv/backup","date":"2026-10-18"}],"damaged":[],"lastRun":null,"relay":null,"warnings":[],"firewallClosed":false,"version":"0.12.1","updatedFrom":null,"updateAvailable":null} {"state":"idle","text":"All good; last backup 2026-10-18 14:02","progress":null,"bytesDone":null,"bytesTotal":null,"scanning":false,"currentItem":null,"lastSuccessUtc":"2026-10-18T14:02:51Z","nextRun":"2026-10-19T06:14:00Z","machine":"ANNA-LAPTOP","port":47800,"loopbackOnly":false,"companyKey":"3F9A-C2D1","fanOutBacklog":{"files":0,"bytes":0},"incomplete":[],"damaged":[],"lastRun":{"state":"ok","summary":"61 new, 4 changed, 3847 unchanged (linked), 212.7 MB","startedUtc":"2026-10-18T13:58:10Z","finishedUtc":"2026-10-18T14:02:51Z"},"relay":null,"warnings":[],"firewallClosed":false,"version":"0.12.1","updatedFrom":null,"updateAvailable":null} ``` ### start ``` start ``` Starts Space Backup and waits until it answers (up to a minute). Already running: says so, exit 0. - Windows: starts `SpaceBackup.exe` (the tray app). - Linux: starts the systemd user service when it is installed, else the daemon directly. - macOS: starts the LaunchAgent when it is installed (`install`), else the daemon directly. ```powershell PS C:\> sbctl start Space Backup started ``` ### stop ``` stop ``` Quits Space Backup (the Windows tray app, the Linux or macOS daemon). A backup that was running is resumed at the next start. On macOS, launchd does not start it again after `stop` (it does at the next login, or with `start`). Not running: says so, exit 0. > **Note:** On Linux, quitting the graphical app (spacebackup-gui) does *not* stop backups; only `stop` (or **Stop service…** in its window) stops the daemon. ```powershell PS C:\> sbctl stop Space Backup stopped ``` ### restart ``` restart ``` `stop`, then `start`. Needed after a few settings (for example `port`); the answer of `settings set` says so. ```sh $ spacebackup restart spacebackup.service: active ``` ### now ``` now […] [--wait] [--date YYYY-MM-DD] ``` Backs up now: everything, or exactly the given files and folders (the Explorer and file manager verb **Space Backup Now**). If a backup is already running, this one starts right after it. | Argument / option | Meaning | |---|---| | `…` | files or folders to back up now (up to 1000). They do not need to be in a backed-up folder. Paths that do not exist are reported; all of them missing is exit 1. | | `--wait` | wait until the run ends and print its summary. Exit 0 OK, 4 warnings or partial, 1 nothing backed up. | | `--date YYYY-MM-DD` | for testing only, needs `--wait`: back up into that date's folder. | JSON fields: `started`, `queued` (it waits for the running backup), `runId`, `run` (with `--wait`: the finished run, fields as in [runs show](#runs-show)), `message`. ```sh $ spacebackup now --wait backup finished: Ok: 214 new, 12 changed, 12194 unchanged (linked), 1240.5 MB 9f3c2a71e0b84d5c9a1e6f2b7c8d0e11 2026-10-18 14:15 -> 14:19 now ok 226 copied (1.21 GB), 12194 linked, 0 unchanged, 0 skipped, 0 failed; 2 destination(s) ``` ### cancel ``` cancel [--restore] ``` Cancels the running backup. A cancelled run is not resumed later (an interrupted one, for example by a shutdown, is). Nothing running: exit 1 `no backup is running`. `--restore` stops the restores running now instead (the **Stop** button of the Restore window). The files restored so far stay. Each stopped restore ends with `cancelled: true` and exit 4; nothing running: exit 1 `no restore is running`. ```powershell PS C:\> sbctl cancel cancelling the running backup (it is not resumed) ``` ## Folders {#folders} The folders this computer backs up. See [Folders](03-backing-up.md#folders) for what each choice means. ### folders list ``` folders [list] ``` The backed-up folders: frequency, destinations, last and next backup, where the copies are, and size. Listing never reads the disk: the size and file count are those measured by the last backup (or, for a folder not backed up yet, by a background count at low priority), and are `null` until measured. Text: one block per folder, headed `D:\Projects (300.3 GB · 146,402 files)` (or `size pending`, `calculating… 12,340 files`), then a `Total: … in N folders` line. A folder that no longer exists is marked `(MISSING)`. JSON (a plain array, one object per folder): `path`, `exists`, `frequency` (as set), `effectiveFrequency` (what applies, for example the global one), `choice` (`once`, `daily`, `weekly`, `monthly` or null), `destinationsMode` (`all`, `auto:N`, `selected:…`), `placement` (where the copies are), `lastBackupUtc` (for `once`: the date of its one backup), `nextRunUtc`, `running`, `incompleteDate`, `warning`, `selectedDestinations`, `copies`, `sizeBytes`, `files`, `sizeAsOf` (when it was measured), `countingFiles` (files counted so far while a count runs), `encrypt` (the folder's setting; null where the platform has no encryption), `encryptPending` (encryption is on but this computer cannot encrypt yet: backed up as plain files until it can), `destinations` (each drive it goes to: `id`, `name`, `encrypted` true or false; a drive can differ from the folder's setting, see `--plain-dest`), `keep` (its own number of backups kept on each drive, `null`: the global setting), `effectiveKeep` (the number that applies), `backups` (its backups on the drives now). ```sh $ spacebackup --json folders [{"path":"/home/anna/Documents","exists":true,"frequency":"night","effectiveFrequency":"night","choice":"daily","destinationsMode":"all","placement":"ANNA-LAPTOP:/media/anna/Backup, OFFICE-NAS:/srv/backup","lastBackupUtc":"2026-10-18T06:14:03Z","nextRunUtc":"2026-10-19T06:14:00Z","running":false,"incompleteDate":null,"warning":null,"selectedDestinations":null,"copies":null,"sizeBytes":8724152320,"files":40211,"sizeAsOf":"2026-10-18T06:12:40Z","countingFiles":null,"encrypt":true,"encryptPending":false,"destinations":[{"id":"ANNA-LAPTOP:/media/anna/Backup","name":"ANNA-LAPTOP → /media/anna/Backup/SpaceBackup","encrypted":true},{"id":"OFFICE-NAS:/srv/backup","name":"OFFICE-NAS → /srv/backup/SpaceBackup","encrypted":false}]}] ``` ### folders add ``` folders add [--frequency F] [--dest D] [--encrypt on|off] [--plain-dest IDS] [--encrypted-dest IDS] [--keep N|global] ``` Starts backing up a folder (**Add to Space Backup** in Explorer and the file managers, **Add…** in Backed-up folders). Adding a folder that is already in the list changes nothing except the options given. | Option | Meaning | |---|---| | `--frequency F` | how often; default `daily`. Any value of [Frequency](#frequency). | | `--dest D` | where it goes; default `all`. See [Destinations](#dest-values). | | `--encrypt on\|off` | **Encrypt this folder's backups**, on every drive it goes to; default `on`. Takes effect once this computer is signed in (`account signin`); until then the folder is backed up as plain files and `folders list` shows `encryptPending: true`. | | `--plain-dest IDS` | these drives get the folder as plain, readable files (ids as in `dest list`, separated by `\|`); its other drives follow `--encrypt`. A folder with selected destinations goes to them too. | | `--encrypted-dest IDS` | these drives get it encrypted (with `--encrypt off`, the exceptions the other way). | | `--keep N\|global` | backups of the folder kept on each drive it goes to: a number 1–999, or `global` (default: the setting `max-backups`, **Backups to keep on each drive**). | The answer says what was done: ```powershell PS C:\> sbctl folders add D:\Projects --frequency weekly --dest auto:2 Added D:\Projects: weekly, in the night window to 2 copies placed automatically, encrypted; first backup 2026-10-19 02:41 PS C:\> sbctl folders add D:\Home --frequency daily:03:00 --dest "selected:CHIA2:K:\|CHIA3:I:\" --plain-dest "CHIA2:J:\|CHIA3:E:\" Added D:\Home: daily at 03:00 to 4 drives, encrypted on 2 (CHIA2:K:\, CHIA3:I:\), not encrypted on 2 (CHIA2:J:\, CHIA3:E:\); first backup 2026-10-19 03:00 ``` ### folders remove ``` folders remove ``` Stops backing up a folder (**Remove from Space Backup**). The backups already made stay on the destinations until they age out. A path that is not in the list: exit 1. ```sh $ spacebackup folders remove ~/Downloads removed /home/anna/Downloads; files already backed up are kept ``` ### folders set ``` folders set [--frequency F] [--dest D] [--encrypt on|off] [--plain-dest IDS] [--encrypted-dest IDS] [--keep N|global] ``` Changes a folder's frequency, destinations, encryption or backups kept. At least one option is required (else exit 2). `--keep N` keeps N backups of the folder on each drive (1–999), `--keep global` goes back to the setting `max-backups`. A smaller number deletes nothing at once: the oldest dates of the folder go at its next backup, and the answer says how many. Its newest backup always stays. `--encrypt` is the form of every drive (their own choices are dropped); `--plain-dest` and `--encrypted-dest` change only the drives named; `--dest` never changes a form. Each drive keeps its own chain: switching a drive's form starts a new chain of backups of the folder there from its next run, the other drives go on linking; older dates stay as they were, and restore, `history` and `browse` read both forms. Exit 1: an unknown destination id; 2: a drive in both lists. ```powershell PS C:\> sbctl folders set D:\Projects --dest "selected:ANNA-PC:E:\|OFFICE-NAS:/srv/backup" D:\Projects: frequency weekly, destinations selected:ANNA-PC:E:\|OFFICE-NAS:/srv/backup; next backup 2026-10-19 02:41 ``` ```powershell PS C:\> sbctl folders set D:\Projects --keep 3 D:\Projects: frequency weekly, destinations all, encrypted, keeps 3 backups on each drive; next backup 2026-11-01 02:41; 7 older backups of it go from each drive at its next backup ``` ## Destinations and paired computers {#destinations} A *destination* is a drive or folder that holds backups: on this computer, or on another computer of your company (a *paired* computer or *peer*). See [Destinations](03-backing-up.md#destinations). ### dest list ``` dest [list] ``` This computer's destinations and the paired computers' that it can use: id, computer, path, kind of drive, online, free space, speed, how it is reached. (`destinations` and `dests` are accepted for `dest`.) The **id** is `COMPUTER:path` (`ANNA-PC:E:\`, `OFFICE-NAS:/srv/backup`); other commands take it. JSON (array): `id`, `machine`, `local` (on this computer), `path` (as added), `root` (the folder that holds the backups, `/SpaceBackup`), `kind` (`internal`, `external` or `network`; null when not known, for example a computer on an older version), `online`, `free` (bytes), `writeMBps`, `media` (SSD/HDD where known), `status`, `reached` (`local`, `lan`, `direct` or `relayed`), `lastSeenUtc`, `lastCopyUtc`, `incompleteDate`, `lan` (how other computers on the network open it, see [dest lan](#dest-lan)), `lanSetting`, `writing` (the running backup is writing there now), `fanOutBacklog`, `lastCheckUtc` (last integrity check), `damaged`, `speedRank` (1 = fastest measured). ```powershell PS C:\> sbctl dest ANNA-PC:E:\ (this PC), external drive: online, 812.40 GB free, 140 MB/s, local backups in E:\SpaceBackup; last copy 2026-10-18 02:31 OFFICE-NAS:/srv/backup, internal drive: online, 3120.55 GB free, 95 MB/s, lan backups in /srv/backup/SpaceBackup; last copy 2026-10-18 02:29 ``` ### dest add ``` dest add ``` Adds a destination on this computer. Backups go into `\SpaceBackup` (or into `` itself if it is already named `SpaceBackup`). If the drive cannot make hard links, the answer says so: each date folder then takes the full size. ```sh $ spacebackup dest add /media/anna/Backup destination added: ANNA-LAPTOP:/media/anna/Backup (backups go to /media/anna/Backup/SpaceBackup) ``` ### dest remove ``` dest remove ``` Removes a destination of this computer. Its backups stay on the disk. A destination of another computer cannot be removed here (remove it on that computer, or `dest forget` it if that computer is gone). ```powershell PS C:\> sbctl dest remove E:\ destination removed: ANNA-PC:E:\; its backups stay in E:\SpaceBackup ``` ### dest forget ``` dest forget ``` Forgets a paired computer's destination that is gone (the computer was retired, the drive removed). If that computer is still online, the destination comes back with its next announcement. ```sh $ spacebackup dest forget OLD-PC:/mnt/backup forgot OLD-PC:/mnt/backup ``` ### dest lan ``` dest lan <\\PC\Share|auto|none> ``` How other computers on your network open a destination of this computer: the iPhone's **About this photo** gives a photo's path through it (for a backup that is not encrypted), to copy and open from a Windows computer. It is told to your other devices with the destination. - `auto` (the default): the network share (SMB) that holds the destination's backup folder, found on this computer: a shared folder on Windows; on Linux a Samba share (smb.conf, or "Share this folder" in the file manager) while Samba runs. A Mac finds none yet. Administrative shares such as `F$` are never used. - `\\PC\Share` (or `//PC/Share`, also with a folder after it): this path, for a share that is not found (another name for the computer, a share set up some other way). - `none`: nothing, even though a share holds it. `dest list` shows it after the backup folder (`--json`: `lan`, and `lanSetting`: `auto`, `none` or `set`). Exit 1: not a network path, an unknown destination, or one of another computer (set it there). ```sh $ spacebackup dest lan /srv/backup '\\OFFICE-NAS\SpaceBackup' OFFICE-NAS:/srv/backup: on the LAN \\OFFICE-NAS\SpaceBackup ``` ### peers list ``` peers [list] ``` The paired computers this one has seen: online, how reached and how fast, address, version, number of destinations, last seen. JSON (array): `name`, `inst` (the install's id), `address`, `online`, `viaRelay`, `reached`, `setupMs`, `lastSeenUtc`, `destinations`, `version`. ```sh $ spacebackup peers OFFICE-NAS: online, lan 3 ms, at 192.168.1.20:47800, version 0.12.1, 1 destination(s), last seen 2026-10-18 14:20 ANNA-PC: online, relayed 48 ms, at 203.0.113.7:47800, version 0.12.1, 1 destination(s), last seen 2026-10-18 14:19 ``` ## Settings {#settings} ### settings get ``` settings [get] [] ``` Every setting with its value, or one (`settings ` is the same as `settings get `). Aliases are accepted (see the table below). A key that does not exist: exit 2; a key of another platform: exit 1 (`… is not a setting on windows`). Secrets (`relay-token`) are shown only as set or not set. JSON: an array of settings, or one: `key`, `value`, `description`, `values` (what it takes), `readOnly`, `secret`, `restartNeeded`. ```powershell PS C:\> sbctl settings machine = ANNA-PC max-backups = 30 frequency = night night-window = 01:00-05:00 incoming = 2 start-with-windows = yes wake = yes name-first = yes scrub = weekly port = 47800 (restart to apply) relay = on relay-status = Not needed: all PCs are on this network (read-only) … ``` ### settings set ``` settings set [--file F] ``` Changes a setting. The value is checked before it is sent (a bad value is exit 2 with the values allowed). A value with spaces may be given in quotes or as several words. `-` as the value reads it from stdin, and `--file F` from the first line of a file (for secrets such as `relay-token`, so they are not on the command line). The answer is ` = `, plus `(restart to apply: … restart)` where needed. ```sh $ spacebackup settings set night-window 00:30-05:30 night-window = 00:30-05:30 ``` ### Settings keys {#settings-keys} The Settings window shows only what a user needs. The keys marked **CLI only** never appear in any window on any platform; they keep their defaults until changed here (or in `config.json`), a non-default value keeps working, and saving the Settings window never touches them. Support and agents change them with `settings set`. | Key | Also accepted | Values | Platforms | What it is | |---|---|---|---|---| | `machine` | `machine-name`, `computer-name` | a name | all | This computer's name: the folder its backups go into and its device name in the company. Letters, digits, `-`, `_`, `.`, up to 64. Setting it checks that no other active computer of the company has it (exit 7 with a free name otherwise), saves it and restarts Space Backup to use it. When there are backups under the old name it says "Backups from now on go into ; the earlier ones stay under ." See [Choose a computer name](02-getting-started.md#computer-name). | | `max-backups` | `backups-to-keep`, `keep` | 1–999 | all | **Backups to keep on each drive**: dated backups kept per computer on each destination (one per day). A folder may keep its own (`folders set --keep`). The newest backup of each listed folder is kept on top of these. Fewer: the older dates go at the next backup, and the answer says how many. | | `frequency` | | `night`, `hourly`, `every:N`, `daily:HH:mm`, `weekly::HH:mm`, `manual` | all | The global frequency (folders set to `global` follow it). No `once`, `weekly`, `monthly` here. | | `night-window` | `window` | `HH:mm-HH:mm` | all | The night window, for example `01:00-05:00`. | | `incoming` | `max-incoming`, `incoming-backups` | 1–16 | all | Other computers backing up to this one at a time (more wait their turn). | | `start-with-windows` | `autostart` | yes/no | Windows | Start Space Backup when you sign in to Windows. | | `wake` | `wake-for-backups` | yes/no | Windows | Wake the computer from sleep for scheduled backups. | | `name-first` | `computer-name-first` | yes/no | all | `SpaceBackup\\` (yes) or `SpaceBackup\\` (no). | | `scrub` | `check-backups` | `weekly`, `monthly`, `off` | all | The integrity check of this computer's destinations: re-read in the night window, damaged files repaired. | | `port` | | 1–65535 | all | **CLI only.** TCP port for other computers, default 47800 (UDP 47801 is used for discovery). Restart to apply; `status` shows the port in use. | | `relay` | `use-relay` | on/off | all | Connect computers at other sites through Space Relay. On by default, no token needed. Setting it records your choice: updates never change it again. | | `relay-status` | | read-only | all | "Connected · 1.2 GB relayed this month", "Not needed: all PCs are on this network", "Can't reach the relay (offline?)", "Activation needed: …". | | `relay-balance` | | read-only | all | The company's relay credit in one line, `Free this month: 3.2 / 5 GB · Prepaid: 87 GB` (read every 10 minutes, or by `relay balance`); empty when not signed in. | | `relay-activate-url` | | read-only | all | Once this month's free relay traffic is used: the page that activates Space Relay for the company (`https://spacebackup.net/account/relay/activate?group=`); else empty. | | `relay-address` | | `host:port` | all | **CLI only.** The relay server, default `relay.spacebackup.net:47900`. | | `relay-token` | | a token, `-` (stdin), `--file F`, `none` | all | **CLI only.** Only for pre-provisioned relay accounts; not needed otherwise. Never printed (`settings get` shows set / not set). | | `relay-fingerprint` | | SHA-256 hex, or `none` | all | **CLI only.** `none` (default): the relay's certificate is checked normally. A hex value pins a self-signed relay certificate. | | `direct-connections` | `relay-direct`, `allow-direct` | yes/no | all | **CLI only.** Direct connections from other sites (router port mapping by UPnP/NAT-PMP, removed on exit). Default yes. | | `cross-filesystems` | | yes/no | Linux, macOS | **CLI only.** Descend into other file systems mounted inside a backed-up folder. Default no. | | `lan-discovery` | | yes/no | Linux, macOS | Find other computers on the local network. `no` (tests): only through Space Relay. Restart to apply. | | `updates` | | `automatic`, `notify`, `off` | all | Auto-update: install when idle, only tell, or never check. See [Automatic updates](03-backing-up.md#updates). | | `update-channel` | | `stable` | all | The update channel (only `stable` for now). | | `txlog-days` | | 7–3650 | all | Days the transaction log is kept (compressed after 7). Default 90. | | `rearrange-wait-days` | | 1–365 | all | Days a phone's new drive waits for a computer that is off and may hold the date in the form it wants, before the phone is asked to send the date again. Default 7. | | `dead-run-hours` | | 1–720 | all | Hours without a write after which a date whose run is gone (the phone app was ended, a computer crashed) is closed by this computer: complete if nothing of the previous full date is missing, else partial. Default 2. See [Partial dates](03-backing-up.md#partial-dates). | | `album-put-max-gb` | | 1–1024 | all | The largest file, in GB, a phone may send into an album (its "From other apps" album, a public link's copy). Larger ones are refused and the phone says why. Default 4. | | `explorer-badge` | | read-only | Windows | Whether the Explorer badge is installed (`shell install`). | | `company-key` | | read-only | all | The company key's fingerprint (the `key` commands change it). | ## Company key {#key} The *company key* lets the computers of a company recognise and trust each other. A computer signed in to the company account gets it automatically from another computer of the company; the `key` commands are for computers that are not signed in, and for support. See [The company key](12-security.md#company-key). > **Warning:** On a computer that is signed in, the company key comes from the account: `key generate` and `key set` refuse (`this PC is signed in as : its company key comes from the account`). ### settings auto-accept-company ``` settings auto-accept-company [on|off] ``` The account setting **Automatically accept albums shared by people in my company** (on by default; kept by the account service, so it is the same on all your devices; the same as `albums auto-accept`). On: an album a colleague shares with you is in your albums at once. Off: it arrives as an invitation, to accept or decline (`albums invitations`); turning it on again does not accept the invitations already waiting. Without on/off it shows the setting. JSON: `{autoAcceptCompany}`. ```sh $ spacebackup settings auto-accept-company off off: albums shared by people in your company arrive as invitations, to accept or decline (albums invitations) ``` ### key fingerprint ``` key [fingerprint] ``` The company key's fingerprint, the same on every computer that has the same key. The key itself is never printed except by `key show`. No key set: exit 1 `no company key set`. JSON (for every `key` command): `set`, `fingerprint`, `key` (only from `key show`), `copied`. ```sh $ spacebackup key 3F9A-C2D1 ``` ### key generate ``` key generate [--copy] [--force] ``` Makes a new company key and uses it, and prints its fingerprint. Give the same key to the other computers (`key show` here, `key set` there). | Option | Meaning | |---|---| | `--copy` | also copy the key to the clipboard (Windows; the Linux daemon has no clipboard: use `key show`) | | `--force` | replace a key that is already set. Without it, a set key is never replaced (exit 1): a new key separates this computer from the others. | ```powershell PS C:\> sbctl key generate --copy company key generated and set, fingerprint 7B21-04EE; copied to the clipboard give the same key to the other PCs: sbctl key show here, sbctl key set there ``` ### key set ``` key set |- [--file F] ``` Uses this company key (the same on every computer of the company). `key set -` reads it from stdin (a leading byte-order mark, which PowerShell sends when piping, is ignored), `--file F` from a file's first line, so the key is not in your shell history. ```sh $ spacebackup key set --file /media/anna/USB/company-key.txt company key set, fingerprint 7B21-04EE ``` ### key show ``` key show ``` Prints the company key itself. Only this command ever prints it. No key set: exit 1. ```powershell PS C:\> sbctl key show K7MXP-… ``` ### key clear ``` key clear --force ``` Removes the company key: this computer stops working together with the others. `--force` is required (else exit 2 with an explanation). ```sh $ spacebackup key clear --force company key removed ``` ## History, browse and restore {#history-restore} These commands find and bring back backed-up files. The Restore window uses them. See [Restoring files](03-backing-up.md#restore). ### history ``` history [--folder P] [--dest ID] [--pc NAME] ``` The date folders on each destination: complete or not, files and size. Without `--pc` these are this computer's own backups and those of the paired computers that back up to its destinations (`machine` says whose). This computer's own date folders on the online paired computers holding them are listed too (each one is asked, 15 seconds at most; one that is offline shows the newest date this computer knows of). | Option | Meaning | |---|---| | `--folder P` | only the dates that hold this backed-up folder | | `--dest ID` | only this destination | | `--pc NAME` | another computer's date folders: one shared with you, or after an approved `recover request`, on this computer's destinations and on the online paired computers holding them. With this computer's own name: its own. Not shared and none here: exit 1 `… are not shared with you …`. Cannot be combined with `--folder` (exit 2). | JSON (array): `dest`, `machine`, `date`, `path`, `complete`, `online`, `files`, `bytes`, `folders`. ```powershell PS C:\> sbctl history --folder D:\Projects ANNA-PC:E:\: 2026-10-18 complete 146,402 files, 300.31 GB [D:\Projects] 2026-10-11 complete 145,870 files, 298.02 GB [D:\Projects] OFFICE-NAS:/srv/backup: 2026-10-18 INCOMPLETE 98,114 files, 201.45 GB [D:\Projects] ``` ### browse ``` browse [] [--date YYYY-MM-DD|latest] [--from HOST] [--pc NAME] ``` What is directly inside a folder in one backup: name, folder or file, size, modified. The Restore window's file list. - Without `--pc`, `` is a folder of this computer as it was backed up (its original path). The backup used is the newest one (a complete date before an incomplete one; this computer's destinations before another computer's when they are as new), or `--date`'s. It is read from this computer's destinations or from the online paired computers holding its backups; no share or approval is needed for your own backups, and encrypted names are decrypted with this computer's own keys. - With `--pc NAME`, it is another computer's backup that is shared with you (or that you may restore after an approved `recover request`). `` is the path as it was on that computer (`C:\Users\bob`, `/home/bob`); without a path you get its drives (`C:\` or `/`). Plain and encrypted folders of a date are shown together. An encrypted backup this computer has no key for: exit 1. - On Linux and macOS, names that a Linux or Mac computer had to escape (`a%3Ab.txt`) are shown as they were (`a:b.txt`), with their modification times and symbolic links. | Option | Meaning | |---|---| | `--date` | that date's backup, or `latest` (default) | | `--from HOST` | read only from that paired computer | | `--pc NAME` | another computer's backups (see above) | No backup of that date holds the folder: exit 1. Without a path and without `--pc`: exit 2. JSON: `path`, `date`, `complete`, `from` (`this PC` or the computer it was read from), `encrypted`, `items` (each: `name`, `path`, `folder`, `size`, `modifiedUtc`), `unreadable` (entries whose long encrypted name could not be shown when read from another computer: restore the folder to get them). ```sh $ spacebackup browse ~/Documents/Reports --date 2026-10-17 /home/anna/Documents/Reports in the backup of 2026-10-17, from this PC (encrypted): 1 folder(s), 2 file(s) folder 2026-09-30 11:02 2025/ 1.2 MB 2026-10-16 17:44 q3.xlsx 310.4 KB 2026-10-02 09:15 plan.docx ``` ### restore {#restore} ``` restore [--date YYYY-MM-DD|latest] [--to DIR] [--overwrite|--keep-both|--skip] [--pc NAME] [--from HOST] ``` Copies a backup back. `` is either: - a path **inside a date folder** of a backup, as Explorer or the file manager shows it (`E:\SpaceBackup\ANNA-PC\2026-10-17\D\Projects\plan.docx`). `--date` and `--from` do not apply then (exit 2). - an **original path** (`C:\Users\anna\Documents\report.docx`, `/home/anna/Documents`), looked up in the newest backup that has it (or `--date`'s) on this computer's destinations and on the paired computers that hold its backups. Every online one is asked; the newest complete copy wins, this computer's own destinations when theirs is as new. Encrypted backups are found by their original path and decrypted on the fly with this computer's keys. Where it goes: by default back where it was backed up from (in place). `--to DIR` restores into that folder instead: a file keeps its name, a folder's contents go into `DIR`. When a file is already there it is skipped (`--skip`, the default), unless you give `--overwrite`, or `--keep-both`, which keeps both under a new name, `report (restored 2026-10-05).docx`. Only one of the three may be given (exit 2). Every restored file is checked against its date folder's manifest (the list of files and their hashes) and read back. On Linux and macOS, names, permissions, modification times (to the nanosecond) and symbolic links come back as they were. | Option | Meaning | |---|---| | `--date` | that date's backup, or `latest` (default) | | `--to DIR` | the folder to restore into (required with `--pc` for another computer) | | `--overwrite` / `--keep-both` / `--skip` | what to do with a file that is already there (default `--skip`) | | `--pc NAME` | another computer's backups: plain ones directly, encrypted ones once `recover request ` was approved or that computer's backups are shared with you. `` is the path on that computer. When its backups are not on this computer's destinations (or `--from` names a computer), they are read from the paired computers that hold them, with a ticket from the account service; the item is first copied into this computer's data folder (`restore-staging`, removed afterwards; it needs that much free space for a moment) and restored from there with the usual checks. With this computer's own name, the same as no `--pc` (`--to` optional). | | `--from HOST` | read only from that paired computer | Exit codes: 0 all restored; 4 some files failed and others were restored, or it was stopped with `cancel --restore`; 1 nothing restored (not found, not shared with you: `… are not shared with you and no restore of them was approved for this PC …`). The restore runs inside the app, so the app must be running (exit 3 otherwise). JSON: `from`, `to`, `date`, `files`, `bytes`, `verified`, `overwritten`, `keptBoth`, `skippedExisting`, `damaged`, `incomplete` (from a date folder whose backup did not complete), `existing` (files skipped because they were there), `errors`, `cancelled`. ```powershell PS C:\> sbctl restore C:\Users\anna\Documents\Reports --date 2026-10-17 --to C:\Restored --keep-both restored 41 file(s), 18.4 MB from E:\SpaceBackup\ANNA-PC\2026-10-17\C\Users\anna\Documents\Reports (2026-10-17) to C:\Restored; 41 checked against the manifest, 2 kept both ``` Another computer's backups, shared with you: ```sh $ spacebackup restore 'C:\Users\bob\Desktop\budget.xlsx' --pc BOB-PC --to ~/FromBob Restored 1 file(s), 0.3 MB from OFFICE-NAS (2026-10-18) to /home/anna/FromBob ``` ## Account and company {#account} Signing in, the company, and its members. Most of these need this computer to be signed in; member management needs the company's owner or an admin. See [Sign in by email link](02-getting-started.md#sign-in), [Join a company](02-getting-started.md#join-company) and [Members](07-administration.md#members). ### account status ``` account [status] ``` Who this computer is signed in as, its company and role, the company key and the encryption state, a sign-in in progress, restore requests, and devices waiting for the company key. `encryption` is `ready` (folders set to Encrypt are encrypted), `waiting` (for the company key; backed up as plain files until then) or `off` (not signed in). JSON fields: `signedIn`, `email`, `company`, `companyId`, `companyDomain`, `autoJoin`, `role` (`owner`, `admin`, `member`), `memberStatus` (`active`, `pending` = an admin has to approve, `invite-needed` = a personal email with no invitation), `deviceId`, `keyVersion`, `keyFingerprint`, `encryption`, `dataKeyId`, `signIn` (`none`, `waiting`, `signed-in`, `failed`), `signInEmail`, `signInError`, `signInExpiresUtc`, `removed` (this computer was removed from the company), `lastSyncUtc`, `lastError`, `accountUrl`, `keyRecoveryId`, `keyRecoveryReleaseUtc`, `requests` (restore requests: `id`, `pc`, `state` = `waiting`/`approved`/`denied`, `createdUtc`), `canRestore` (computers whose backups this one can restore), `machineName`, `machineNameProblem` (`taken`, `invalid` or null), `suggestedMachineName`, `hasBackups`, `keyWait` (this computer waits for the company key: `state`, `holders`, `approvers`, `mailed`, `approverIsMe`, `adminUrl`, `text`), `keyWaitingDevices` (owner/admin: other devices waiting: `id`, `name`, `email`, `text`). ```sh $ spacebackup account Signed in as anna@acme.com Company: Acme (admin) Auto-join: off: people with an @acme.com email need an invitation Company key: version 3, fingerprint 3F9A-C2D1 Waiting: BOB-LAPTOP is waiting for the company key (bob@acme.com): spacebackup devices approve BOB-LAPTOP Encryption: ready (data key d_4f2a…): folders set to Encrypt are encrypted ``` ### account signin {#account-signin} ``` account signin [--wait] [--code N] ``` Passwordless sign-in: a mail goes to `` with a link and a 6-digit code, valid 15 minutes and once. The first computer of a company creates it (and its company key); further computers get the company key end to end from a computer that has it. - Typed at a terminal (no `--json`, input and output not redirected), it asks for the code and at the same time notices the link being clicked, whichever comes first (up to 15 minutes). - Otherwise (a script) it returns at once: give the code with `account code`, or click the link. | Option | Meaning | |---|---| | `--wait` | wait until the link is clicked (up to 16 minutes) | | `--code N` | Windows: pass the code right after starting (the same as `account code N`). Prefer `account code`. | Exit 1 when the sign-in failed. ```sh $ spacebackup account signin anna@acme.com < /dev/null A sign-in mail went to anna@acme.com: click its link, or give its code: spacebackup account code <6 digits> ``` ### account code ``` account code <6 digits> ``` The code from the sign-in mail. A wrong code: exit 1 with the attempts left. Signed in, but the company already has another computer of this name: exit 7 (see `account join`). ```powershell PS C:\> sbctl account code 482913 Signed in as anna@acme.com Company: Acme (member) Company key: version 3, fingerprint 3F9A-C2D1 Encryption: ready (data key d_4f2a…): folders set to Encrypt are encrypted ``` ### account join ``` account join [--create] ``` Joins the company now (the app also tries every minute by itself), for example after an admin invited your email. - A personal email (gmail.com, outlook.com, …) joins a company only by invitation. Without one it prints `Ask your company's admin to invite .` with the two ways on, and exits **6**; `account status --json` shows `memberStatus: "invite-needed"`. - It also accepts an invitation for a computer that is alone in a company of its own with no company key yet (that empty company is deleted). - `--create`: make a new company with this email as its owner. Only when you are setting up Space Backup for a new company. - When the company already has an active computer of this computer's name (or the name cannot be used), it prints the message and the command that fixes it, and exits **7**. ```sh $ spacebackup account join Another computer in your company is already called ANNA-LAPTOP. Choose a name for this computer: spacebackup settings set machine-name ANNA-LAPTOP-2 $ echo $? 7 ``` ### account rename ``` account rename "" ``` Renames your company (owner or admin; 1–100 characters, plain text). A member gets exit 1 `only the company's owner or an admin may do this`. ```powershell PS C:\> sbctl account rename "Acme Inc." Your company is now called Acme Inc. ``` ### account name ``` account name [set "" | clear] ``` Your display name in your company, shown next to your email in albums and in the member and device lists, only inside the company. `set`: "first last": the name is split at its first space into a first and a last name, each up to 40 characters, plain text (a part too long or with control characters: exit 2, `first name is too long (at most 40 characters)`). `clear`: no name. No argument: shows it. An owner or admin can set anyone's on the admin page. JSON: `name` (`""` = none). ```sh $ spacebackup account name set "Anna Kowalski" Your name is now Anna Kowalski ``` ### account invite ``` account invite [--role member|admin] ``` Invites anyone to your company (owner or admin; the admin page's **Invite**): a personal address or one at another domain too. `--role` defaults to `member`. The invitation is mailed; the person joins when they sign in to Space Backup with exactly this address. Someone at your company's domain who is waiting for approval is approved by inviting them. Exit 1: already a member (` is already a member`), in another company that holds anything (` belongs to another company`), or you are not owner or admin. JSON: the member (see `account members`). ```powershell PS C:\> sbctl account invite bob@acme.com --role admin Invited bob@acme.com as admin: the invitation is mailed; they join when they sign in to Space Backup with exactly this address ``` ### account members ``` account members [list] account members approve|deny|remove account members role member|admin ``` Your company's members as the admin page lists them (owner or admin): pending first, then the owner, admins, members. | Form | What it does | |---|---| | `list` (default) | email, role, status (`active`, `invited`, `pending`), name, who invited them | | `approve ` / `deny ` | a pending join (someone at the company's domain, with auto-join off); approved ones are mailed | | `remove ` | removes a member and their devices: sessions ended, shares stopped, the company key replaced. Never the owner. | | `role member\|admin` | makes an active or invited member an admin or a member. Never the owner. | An email not in the list: exit 1. Bad form: exit 2. JSON: `list` gives an array of members; the others give the member after the change (`status: "removed"` after remove or deny). A member: `email`, `name` (`""` = none), `role` (`owner`, `admin`, `member`), `status` (`active`, `invited`, `pending`, `removed`), `invitedBy`, `sinceUtc`. ```sh $ spacebackup account members carol@acme.com member pending anna@acme.com owner active Anna Kowalski bob@acme.com admin invited (invited by anna@acme.com) ``` ### account auto-join ``` account auto-join on|off ``` Lets anyone with an email at your company's domain join without an invitation (`on`), or not (owner or admin). Only for a company with a domain (else exit 1 `auto-join needs a company domain; this company has none`). `account status` shows `Auto-join:` for such a company. ```powershell PS C:\> sbctl account auto-join on Anyone with an @acme.com email may now join Acme ``` ### account web ``` account web [--admin] [--open] ``` The address of your account page on the web: `https://spacebackup.net/account/` (**Your account on the web**), or with `--admin` the company admin page `https://spacebackup.net/account/admin` (members, invitations, devices, approvals, sharing, relay credit; **Manage your company on the web** and the tray's **Company admin page…**). `--open` also opens it in your browser. JSON: `url`, `admin`, `opened` (null without `--open`). ```sh $ spacebackup account web --admin --open Opened in your browser: https://spacebackup.net/account/admin ``` ### account signout ``` account signout ``` Forgets the sign-in on this computer. Backups go on with the keys it has; sign in again to manage devices or restores. ```powershell PS C:\> sbctl account signout Signed out on this PC (backups go on with the keys it has) ``` ### account url ``` account url [URL|default] ``` The account service this computer uses; default `https://spacebackup.net/account`. `default` goes back to it. Only for testing or a private service. JSON: `url`. ```sh $ spacebackup account url https://spacebackup.net/account ``` ### account recover-key ``` account recover-key [--cancel] ``` For admins, when every computer of the company was lost: asks for the company key's recovery copy. It is released after 24 hours unless an admin cancels; every admin gets a mail. `--cancel` cancels a recovery asked for on this computer. See [Company key recovery](07-administration.md#key-recovery). ```powershell PS C:\> sbctl account recover-key Asked for the company key's recovery copy: released 10/19/2026 3:12 PM unless an admin cancels (every admin got a mail) ``` ## Devices {#devices} ### devices list ``` devices [list] ``` The company's computers and phones: name, owner's email, last seen (or removed), system, version, and its id. This computer is marked `(this PC)`. JSON (array): `id`, `name`, `email`, `os`, `version`, `lastSeenUtc`, `removed`, `keyVersion`, `thisPc`. ```sh $ spacebackup devices ANNA-LAPTOP anna@acme.com seen 10/18/2026 2:20 PM linux 0.12.1 (this PC) dev_8c1e… ANNA-PC anna@acme.com seen 10/18/2026 2:19 PM windows 0.12.1 dev_27ab… Annas-iPhone anna@acme.com seen 10/18/2026 1:05 PM ios 2.4 dev_f09d… ``` ### devices approve ``` devices approve ``` Owner or admin: gives a device that is waiting for the company key the key, when no device that holds it handed it over within 2 minutes (`account status` lists them as ` is waiting for the company key`). Never this computer: a waiting computer is approved from the mailed link, the admin page or another device. See [A device waiting for the company key](07-administration.md#key-waiting). ```powershell PS C:\> sbctl devices approve BOB-LAPTOP Approved BOB-LAPTOP (bob@acme.com): it gets the company key with its next sync (within a minute) ``` ### devices remove ``` devices remove ``` Admins: removes a computer from the company. The company key is replaced on the other computers (offline ones get it when they come back). ```sh $ spacebackup devices remove OLD-PC Removed OLD-PC from the company; the company key is rotated on the other PCs (offline ones get it when they come back) ``` ## Restoring another computer {#recover} ### recover list ``` recover [list] ``` Other computers whose backups you may restore here, and the state of each: `available` (ask for it with `recover request`), `waiting` (asked; the owner or an admin has to approve), `approved` (restorable here), `denied`, or `shared` (shared with you: restorable without asking). JSON (array): `deviceId`, `pc`, `email`, `removed`, `state`, `sinceUtc` (for `shared`). ```sh $ spacebackup recover BOB-PC bob@acme.com shared with you: spacebackup restore --pc BOB-PC --to OLD-PC anna@acme.com spacebackup recover request OLD-PC ``` ### recover request ``` recover request ``` Asks to restore another computer's backups on this one. The company owner and admins get a mail; once one approves (by mail or on the admin page), `restore --pc --to ` works here. See [Approving a restore of another computer](07-administration.md#restore-approvals). JSON: `id`, `pc`, `state`, `createdUtc`. ```powershell PS C:\> sbctl recover request OLD-PC Asked to restore OLD-PC's backups on this PC. The company owner and admins got a mail; once one approves, `sbctl restore --pc OLD-PC --to ` works here. ``` ## Sharing a device's backups {#share} Sharing lets a person of your company view and restore a copy of a device's backups, read-only, on all their devices, without an approval for each restore. See [Sharing a device's backups](05-photos.md#sharing-backups). ### share list ``` share [list] ``` Who this computer's backups (admins: every device's) are shared with, then **Shared with me**: the devices shared with you. JSON: `shares` and `sharedWithMe`, each a list of shares: `id`, `pc` (the shared device), `ownerEmail`, `recipientEmail`, `sharedBy`, `sinceUtc`, `thisPc`. ```sh $ spacebackup share Shared: ANNA-LAPTOP with bob@acme.com since 10/12/2026 Shared with me: BOB-PC bob@acme.com since 10/14/2026 (spacebackup restore --pc BOB-PC --to ) ``` ### share add ``` share add [--pc ] ``` Shares this computer's backups (or `--pc`'s: one of your own devices; owners and admins any device) with a person of your company. JSON: the share. ```powershell PS C:\> sbctl share add bob@acme.com ANNA-PC's backups are shared with bob@acme.com: they can view and restore a copy, read-only, on all their devices. ``` ### share remove ``` share remove [--pc ] ``` Stops sharing. Backups made before stay readable to the person who already had access to them; new ones are not shared. It also removes a device shared with you: `share remove --pc `. ```sh $ spacebackup share remove bob@acme.com Stopped sharing ANNA-LAPTOP's backups with bob@acme.com. Backups made before today stay readable to bob@acme.com, who already had access to them. New backups are not shared. ``` ## Albums {#albums} Albums are collections of photos and videos kept on chosen destinations of your company's computers. You can share an album with people of your company, or invite someone outside it as a *guest*. See [Albums](05-photos.md#albums), [Sharing an album](05-photos.md#sharing-albums) and [Guests from outside the company](05-photos.md#guests). An `` argument is the album's name or its id (as `albums list --json` gives it). A `` is a computer's name as `devices list` shows it. ### albums list ``` albums [list] ``` Your albums and the albums shared with you: owner, number of items, where they are kept, who they are shared with, and whether members can add. Albums inside albums are listed under the album they are in, indented, with `N album(s) in it` on the parent; an album shared with you whose parent is not is listed at the top. JSON (array): `id`, `name`, `owner`, `mine`, `items`, `where` (`PC:destination` each), `members` (who it is shared with, for its owner), `membersCanAdd`, `parent` (the album it is in, or `null` at the top level), `children` (the albums directly in it that you see). ```sh $ spacebackup albums Chicago trip mine 128 item(s) on OFFICE-NAS:/srv/backup, ANNA-PC:E:\ shared with bob@acme.com Team offsite shared by bob@acme.com 42 item(s) on BOB-PC:D:\ members can add ``` ### albums show ``` albums show [--from ] ``` An album's items, read from this computer's destinations when it keeps the album, else (or with `--from`) from a computer keeping it, with an album ticket the account service gives the owner's devices and the members it is shared with (others: exit 1). An album shared with you that you turned off is not read: exit 1, "The album is turned off: turn it on first (albums show on, or Turn on in Albums, Shared with me)." JSON: the album's `album.json`: `v`, `id`, `name`, `owner`, `updated`, `items` (each: `id`, `source`, `files`, `thumb`, `kind`, `created`, `place`, `added`, `size`, `addedBy`, `caption`), `removed`. ```powershell PS C:\> sbctl albums show "Chicago trip" Chicago trip (mine), 128 item(s), read from this PC: IMG_0412.HEIC photo 10/3/2026 4:12 PM 2.4 MB from Annas-iPhone IMG_0413.MOV video 10/3/2026 4:15 PM 48.1 MB from Annas-iPhone … ``` ### albums restore ``` albums restore --to [--from ] ``` Saves a copy of an album's photos and videos into ``. Files already there with the same size are skipped. Read as for `albums show`; an album you turned off is refused the same way (exit 1, turn it on first), as are `albums guest-restore` and `albums clone` from it. Exit 4 when some files failed, 1 when none were saved. JSON: `album`, `from`, `to`, `files`, `skipped`, `bytes`, `errors`. ```sh $ spacebackup albums restore "Chicago trip" --to ~/Pictures/Chicago Saved 128 file(s), 1824.6 MB of the album Chicago trip from this PC to /home/anna/Pictures/Chicago ``` ### albums create ``` albums create ``` Makes a new album of yours. Then choose where it is kept with `albums dest`. ```sh $ spacebackup albums create "Chicago trip" Created the album Chicago trip. Choose where it is kept: spacebackup albums dest "Chicago trip" : ``` ### albums import ``` albums import [--dest :]... [--detach] ``` A folder as albums (what dragging a folder onto the app does): **every folder that holds photos or videos directly**, the folder itself and every folder in it, all the way down, becomes an album named as its path from the folder you drag, the folder names joined by " - " (Trips, Trips - Iceland, Trips - Iceland - Day 2), with just that folder's photos and videos. A subfolder's photos are not in the album of the folder around it: the subfolder gets its own album the same way. Albums are never put inside albums; they are all side by side. A folder with no photo or video of its own makes no album (listed as skipped; the folders in it are still looked into), and hidden files and folders (names starting with a dot) and other files (documents, music) are left out. Photos and videos are told by their content, not their names. - **Again is safe.** An album of yours with the same name is reused and added to, and a photo already in it (the same name and content) is not added twice, so dragging the same folder again makes no new album and adds only what is new. Two folders with the same name in different places (`Home/2024`, `Work/2024`) make two albums, Trips - Home - 2024 and Trips - Work - 2024. The answer says which albums were made and which reused. - **Where.** A new album is kept on the `--dest` drives (default: every destination of `dest list`, as **New album**); a reused album stays where it is. - **How.** The files are copied from this computer onto the albums' drives: this computer's own directly, the others' computer to computer (a computer that is off gets them when it is back, as for any album). Nothing needs to be backed up first. - **A job.** It runs as a job of this computer; the command waits and prints the result, or with `--detach` answers at once with the job (follow its progress with `albums imports`). Exit 1 when the folder has no photo or video, or nothing could be imported; 4 when some files failed (each listed). JSON (`AlbumImportInfo`): `job`, `folder`, `state` (`running`, `done`, `failed`), `started`, `ended`, `of`, `done`, `added`, `already`, `albums` (each `id`, `name`, `folders`, `created`, `files`), `failed`, `skipped`, `error`. ```sh $ spacebackup albums import ~/Pictures/Trips Imported /home/anna/Pictures/Trips; 3 album(s) made, 0 reused; 212 photos and videos added, 0 already there made: Trips, Trips - 2026, Trips - 2026 - Las Vegas skipped (no photo or video of its own): Documents $ spacebackup albums import ~/Pictures/Trips Imported /home/anna/Pictures/Trips; 0 album(s) made, 3 reused; 0 photos and videos added, 212 already there reused: Trips, 2026, Las Vegas ``` ### albums put ``` albums put ... [--album ] [--dest :]... [--detach] ``` Photos and videos of this computer into **one album of yours**, kept as they are: what dropping files on the window does. A folder brings its photos and videos and every folder's below it, all into the one album; other files are skipped (by content). `--album` names the album (yours only: an album shared with you, or a public one, is refused); without it they go into **From Other Apps**, made when it isn't there (on the `--dest` drives, default every destination of `dest list`). The same file put again is already there. A job as `albums import` (`--detach`, `albums imports`); JSON `AlbumImportInfo` with `into`, the album's name. Exit 1 when there is nothing to add or the album is not yours; 4 when some files failed. ```sh $ spacebackup albums put ~/Downloads/IMG_2041.HEIC ~/Pictures/Party Added 38 photos and videos to From Other Apps ``` ### albums imports ``` albums imports [--job ] ``` The folder imports this computer runs or ran (`albums import`), newest first: job, state, files done of all, the folder. With `--job`, that one as `albums import` answers it. Ended ones are kept 24 hours (until the computer restarts). ### albums dest ``` albums dest :... ``` Where the album is kept: destinations of the company's computers, by path or id (up to 8). Replaces the list. Only the album's owner. A computer must be paired with this one so its destinations are known here. From 0.16.33 it also moves the album, as the iPhone does (the app's **Kept on** page does exactly this): - **New drives are filled** by a computer holding the album (this one first), as a job there: computer to computer, and as transfer jobs for computers that are off. Follow it with `albums job --on `. When no computer holding it answers, they fill the new drives themselves within the hour after they are back. - **Dropped drives have their copy deleted** (through a computer keeping the album, later, when theirs is off). - **A drive is dropped only while another drive keeps the whole album**: a drive still being filled does not count, and the last copy is never dropped (exit 1, nothing changed: "None of the other drives keeping Chicago trip has all of it yet (ANNA-PC E:\ has 33 of 397): untick it once one does"). An album with photos keeps at least one drive. ```powershell PS C:\> sbctl albums dest "Chicago trip" OFFICE-NAS:/srv/backup ANNA-PC:E:\ The album Chicago trip is kept on OFFICE-NAS:/srv/backup, ANNA-PC:E:\ Filling ANNA-PC:E:\ from OFFICE-NAS: 397 photos and videos (spacebackup albums job "Chicago trip" --on OFFICE-NAS --job job_3f…) ``` Exit 4 when a dropped drive's copy could not be deleted (its computer is off and no other computer keeping the album could pass it on): it stays there, no longer part of the album. `--json` (`AlbumDestInfo`): `{album, added, dropped, fillOn, job, of, fillLater, removed, left}`. ### albums share ``` albums share ``` Shares your album with a person: read-only for a person of your company (they can view it and save a copy). Someone **outside** the company is invited instead, by mail and on their phone; the invitation lasts 30 days, and once they accept they are a guest of the album (view and save a copy only). ```sh $ spacebackup albums share "Chicago trip" bob@acme.com The album Chicago trip is shared with bob@acme.com: they can view it and save a copy (read-only). ``` ### albums unshare ``` albums unshare ``` Stops sharing an album with a person, withdraws an invitation, or removes a guest. `albums unshare ` leaves an album shared with you. The computers holding it stop serving it to them within 5 minutes. ```sh $ spacebackup albums unshare "Chicago trip" bob@acme.com Stopped sharing the album Chicago trip with bob@acme.com (the PCs holding it stop serving it to them within 5 minutes). ``` ### albums members-can-add ``` albums members-can-add on|off ``` The owner lets the people the album is shared with add to it (`on`): their devices may `albums add` their own backed-up files and `albums clone` into it, and `albums remove` only what they added. `off`: no more adds or removes by members; what they added stays. Deleting the album and choosing where it is kept stay the owner's. Not the owner: exit 1. JSON: the album row (with `membersCanAdd`). ```powershell PS C:\> sbctl albums members-can-add "Team offsite" on The people the album Team offsite is shared with can now add to it (and remove what they added). ``` ### albums add ``` albums add ... --on [--date YYYY-MM-DD] ``` Adds this computer's backed-up files (a file, or a folder's files) to your album, or to one shared with you whose owner lets members add. The computer holding this computer's backups (`--on`, required) copies them into the album, decrypted with this computer's data key lent for that request only (never stored there), and sends them to the album's other computers. `--date`: from that date's backup. A computer keeping the album that is off gets the items when it is back: they wait on `--on` as transfer jobs (exit 0, `N item(s) wait on until it is back`). Exit 4 when some items went and some did not, 1 when none did. ```sh $ spacebackup albums add "Chicago trip" ~/Pictures/Chicago/IMG_2201.jpg --on OFFICE-NAS Added 1 item(s) to the album Chicago trip on OFFICE-NAS and ANNA-PC ``` ### albums remove ``` albums remove ... --on ``` Takes this computer's files out of the album, on every computer keeping it. A member removes only what they added; the others are listed as `: you can remove only what you added` (exit 4 when some went, 1 when none). ```sh $ spacebackup albums remove "Chicago trip" ~/Pictures/Chicago/IMG_2201.jpg --on OFFICE-NAS Removed 1 item(s) from the album Chicago trip ``` ### albums clone ``` albums clone --on [--drive ] [--id ]... ``` Copies the items of another album (yours, or shared with you) into your album (or one whose owner lets members add), computer to computer: `--on` is a computer holding ``, read from `--drive` (its id or path; default its first drive holding it). On that computer's own drives of the album the items are hard-linked when on the same volume, else copied, and they are sent to the album's other computers (a computer that is off: transfer jobs on `--on`, exit 0). Nothing passes through this computer and no key is lent (albums are stored plain). `--id` (repeatable): only those items (ids as `albums show --json` gives them; an id not in it counts as a failure). Each item keeps its source, id, kind and dates; one already in the album is counted as already there. A `--on` computer on an older version: exit 1 ` is an older version without album.clone`. Exit 0 all, 4 some failed, 1 none. JSON: `album`, `from`, `on`, `albumVersion`, `added`, `already`, `failed`, `pushed` (other computers that did not get the items yet). ```powershell PS C:\> sbctl albums clone "Best of 2026" "Chicago trip" --on OFFICE-NAS --id IMG_0412 --id IMG_0413 Cloned 2 item(s) of the album Chicago trip into the album Best of 2026 on OFFICE-NAS and ANNA-PC ``` ### albums caption ``` albums caption "text" albums caption --clear ``` Sets or clears the caption of an album item: plain text, at most 2,000 characters, newlines allowed, no other control characters. A caption may begin with `--`; only `--clear` itself is the option. See [Captions](05-photos.md#captions). - ``: as `albums show --json` lists it, or the Photos viewer's id `a~~~` (from `photos list --source a:`). - The album's owner captions any item; with `albums members-can-add on`, a member only what they added; read-only members: exit 1. - The caption is set on this computer's drives keeping the album, and on the other computers through the first of them that answers, which passes it on; a computer that is off gets it later (exit 0, `: waits on until it is back`). Exit 1: the item is not in the album, is not yours to caption (`refused: You can caption only what you added`), or no computer keeping the album can be reached. 2: bad caption or usage. 4: set, but some computer failed (listed). JSON: `album`, `id`, `source`, `caption` (null when cleared), `captioned` (copies changed), `done` (computers that took it), `pushed` (those that did not yet). > **Note:** Captions of your phone's own backups (outside albums) are set on the phone only. The Photos viewer's **Save caption** and **Clear caption** run this command. ```sh $ spacebackup albums caption "Chicago trip" IMG_0412 "Cloud Gate at sunset" Set the caption of IMG_0412 in the album Chicago trip on OFFICE-NAS, ANNA-PC ``` ### albums delete ``` albums delete ``` Deletes your album and its copies on the computers. A copy that could not be deleted is listed (it stays there; exit 4). ```powershell PS C:\> sbctl albums delete "Old album" Deleted the album Old album ``` ### albums status ``` albums status --on ``` Where the album is, drive by drive, as that computer (the one adding to it) knows it: `done` (with its item count for that computer's own drives), `waiting for ` (transfer jobs kept there, and the last reason), `failed`, `missing`, `offline`. JSON (array): `pc`, `dest`, `state`, `items`, `waiting`, `error`, `drive`. ```sh $ spacebackup albums status "Chicago trip" --on OFFICE-NAS OFFICE-NAS:/srv/backup done, 128 item(s) ANNA-PC:E:\ waiting for ANNA-PC: 3 transfer(s) kept on OFFICE-NAS (offline) ``` ### albums invitations ``` albums invitations ``` Invitations to you to albums of **other companies**, and of your own when `settings auto-accept-company` is off: the waiting ones, then the declined ones, each with the album, who invited you and since when. None expires. JSON (array): `id`, `album`, `albumName`, `fromEmail`, `fromName`, `company`, `created`, `state` (`pending` or `declined`), `sameCompany`, `decided`. ```sh $ spacebackup albums invitations Wedding from Dana Lee (Lee Studio), waiting since 10/30/2026 Picnic from Bob Smith , declined since 10/29/2026 Accept one with: albums accept (a declined one too) ``` ### albums accept ``` albums accept [--trust-sender] ``` Accepts an invitation, a waiting or a declined one (by its id, or the album's name; a waiting one first when both have that name): an album of your company is in your albums at once; one of another company makes you its guest, to view it and save a copy. `--trust-sender` (people outside your company only): albums that person shares with you later are accepted at once. Not found: exit 1; two invitations with that album name: exit 2 (give the id from `albums --json invitations`). ```powershell PS C:\> sbctl albums accept Wedding You can now view the album Wedding from Dana Lee and save a copy (sbctl albums guest-restore "Wedding" --to ). ``` ### albums decline ``` albums decline ``` Declines an invitation. It stays listed as declined, and you can still accept it later. ```sh $ spacebackup albums decline Wedding Declined the invitation to the album Wedding from Dana Lee. It stays under Declined: you can still accept it (albums accept inv_8f2c). ``` ### albums show on|off {#albums-show-on-off} ``` albums show on|off albums turn-on albums turn-off ``` Hides or shows an album **for you alone**: one shared with you (of your company, or one you are a guest of), or your own (iOS requests #85, #87; `POST /account/api/albums/{id}/show {on}`). Hidden, it leaves Photos, Recent and Albums on all your devices and nothing of it is downloaded or cached; the desktop app lists it in **Settings › Hidden albums** with **Show** (a shared one also under Shared with me). A shared one: computers neither list nor open it, you get no notifications about it, and you stay in the album. Your own: it stays shared and backed up, its members see no change, the computers keeping it still serve it (to you too: `albums show`, `albums restore` and its tickets work), and its faces still count for your People. `albums list` shows it as "turned off" (`--json` `shown: false`, `mine: true` for your own). The desktop app's **Hide album** (an album's right-click and its page) does the same. ```sh $ spacebackup albums show "Old party" off The album Old party is hidden: it no longer shows in Photos, Recent and Albums on your devices, nothing of it is downloaded, and you get no notifications about it. Show it again with: albums show al_3k9 on (Settings, Hidden albums) $ spacebackup albums show "Trip 2025" off The album Trip 2025 is hidden: it no longer shows in Photos, Recent and Albums on your devices, nothing of it is downloaded; it stays shared and backed up. Show it again with: albums show al_7q2 on (Settings, Hidden albums) $ spacebackup albums show "Old party" on The album Old party shows again in Photos, Recent and Albums. ``` ### albums guest ``` albums guest ``` The albums of other companies you are a guest of: owner, company, items, the computers keeping it. JSON (array): `id`, `name`, `owner`, `ownerName`, `company`, `items`, `pcs`. ```sh $ spacebackup albums guest Wedding by Dana Lee (Lee Studio), 312 item(s), on STUDIO-NAS ``` ### albums guest-restore ``` albums guest-restore --to ``` Saves a copy of an album of another company you are a guest of, read from its computer through Space Relay with this computer's registered key and the album's ticket (view and save only). Exit 1 when the album is not found or no computer of it can be reached; 4 when some files failed. JSON: as `albums restore`. ```sh $ spacebackup albums guest-restore Wedding --to ~/Pictures/Wedding Saved 312 file(s), 4120.3 MB of the album Wedding from STUDIO-NAS to /home/anna/Pictures/Wedding ``` ## Photos {#photos} The `photos` commands are what the **Photos** window on a computer shows and does: the photos and videos backed up from your phones (and those shared with you), and your albums. See [The Photos window on a computer](05-photos.md#desktop-photos). `photos` alone is `photos list`. An item **id** looks like `d~Annas-iPhone~0123456789abcdef` (an item of a device's backups) or `a~~~` (an item of an album); `photos list` prints them. ### photos open ``` photos open ``` Starts this computer's local viewer server (on `127.0.0.1`, a random port) if it is not running, and prints its address with this session's secret; the app's **Photos…** window loads it. The secret changes when the app restarts and when you sign out. JSON: `url`, `port`, `secret`. ```sh $ spacebackup --json photos open {"url":"http://127.0.0.1:51734/?s=k3JX…","port":51734,"secret":"k3JX…"} ``` ### photos sources ``` photos sources ``` The devices whose photos this computer can show (yours, and those shared with you) and the albums you see: what the viewer's **All**, **Albums** and **Shared with me** list. Each has a key: `d:` or `a:`, used by `photos list --source`. JSON (array): `key`, `name`, `kind` (`device` or `album`), `mine`, `owner`, `items`, `problem` (why it cannot be read, in plain words: encrypted and no key here, its computer offline; null when it can), `canAdd`. ```sh $ spacebackup photos sources Annas-iPhone device yours d:Annas-iPhone Chicago trip album yours a:alb_7c21… Bobs-iPhone device shared by bob@acme.com d:Bobs-iPhone ``` ### photos list ``` photos list [--source KEY]... [--type T] [--search TEXT] [--from YYYY-MM-DD] [--to YYYY-MM-DD] [--archived | --deleted] [--limit N] ``` Photos and videos, newest first: id, kind, date taken, place. | Option | Meaning | |---|---| | `--source KEY` | (repeatable) only these sources (`d:`, `a:`); default all of your own | | `--type T` | `photo`, `video`, `live`, `favorite`, or a media type: `selfie`, `portrait`, `screenshot`, `screenRecording`, `slomo`, `timelapse`, `burst`, `raw`, `spatial`, `cinematic`, `panorama` | | `--search TEXT` | a place or a date: `Chicago`, `"Oct 2026"`, `2026-10-13` | | `--from`, `--to` | taken between these dates | | `--archived` | the **Archived** folder's items instead (archived on the iPhone) | | `--deleted` | the **Deleted** folder's items instead (deleted in the iPhone's Photos tab); not with `--archived` | | `--limit N` | at most N items | JSON (array, the viewer's items): `id`, `source`, `device`, `itemId`, `kind` (`photo`, `video`, `live`), `created`, `modified`, `uploaded`, `w`, `h`, `duration`, `lat`, `lon`, `favorite`, `types`, `caption`, `addedBy`, `files`, `edited`, `thumb`, `archived`, `deleted`, `size`, `place`. ```sh $ spacebackup photos list --search Chicago --limit 2 d~Annas-iPhone~0123456789abcdef photo 2026-10-03 16:12 Chicago, Illinois, United States d~Annas-iPhone~fedcba9876543210 live 2026-10-03 15:58 Chicago, Illinois, United States 2 item(s) ``` ### photos map ``` photos map [--whose all|mine|shared] [--search TEXT] [--limit N] ``` The photo map (**Places › Map**): every photo and video with a location, as spots joined by place name (else by about a kilometre), most first: how many, the middle, the first and last day, the place. | Option | Meaning | |---|---| | `--whose` | the map's switch: `all` (default), `mine` (your own devices and albums) or `shared` (shared with you) | | `--search TEXT` | only what the search box would keep | | `--limit N` | at most N spots | JSON: `whose`, `located` (how many have a location), `spots`: `place`, `lat`, `lon`, `items`, `newest` (the pin's picture, an id for `photos show`), `from`, `to`. A pin's photos: `photos list --search ""`. Exit 0 also when none has a location; 2: a bad `--whose`. ```sh $ spacebackup photos map --whose shared 12 43.64270 -79.38710 2026-09-30..2026-10-07 Toronto, Ontario 12 with a location, 1 spot(s) ``` ### photos show ``` photos show ``` One item: kind, date taken, place, device, size in pixels or length, files, caption (the viewer's **Info**). JSON: the item, as in `photos list`. ```powershell PS C:\> sbctl photos show d~Annas-iPhone~0123456789abcdef Photo taken Saturday, October 3, 2026 4:12 PM in Chicago, Illinois, United States From Annas-iPhone, 4032 × 3024 Files: IMG_0412.HEIC Caption: Cloud Gate at sunset ``` ### photos save ``` photos save ... --to [--originals] ``` **Save to a folder**: the originals (a Live Photo: both files; an edited item: its edit too), with the date taken as the file time. A file already there with the same size is skipped. `--originals`: one file each, as dragging photos out of the window gives: the edited version where there is one, else the original (a Live Photo's picture). Exit 4 when some failed, 1 when none were saved. JSON (for `save`, `restore`, `preview`): `to`, `items`, `files`, `bytes`, `skipped`, `errors`. ```sh $ spacebackup photos save d~Annas-iPhone~0123456789abcdef --to ~/Desktop Saved 1 item(s), 1 file(s) (2.4 MB) to /home/anna/Desktop ``` ### photos preview ``` photos preview --to ``` Saves the picture the viewer shows, as JPEG (HEIC/HEIF and RAW converted), into ``. ```powershell PS C:\> sbctl photos preview d~Annas-iPhone~0123456789abcdef --to C:\Temp Saved C:\Temp\IMG_0412.jpg ``` ### photos restore ``` photos restore ... [--to ] ``` **Restore**: the originals back to their place, `////`, with the date taken as the file time; already there: skipped. The default `` is `Pictures/Space Backup` in your home folder. ```sh $ spacebackup photos restore d~Annas-iPhone~0123456789abcdef Restored 1 item(s), 1 file(s) (2.4 MB) to /home/anna/Pictures/Space Backup ``` ### photos add ``` photos add ... ``` **Add to album** (album by name or id). Items of an album are cloned into it (as `albums clone`); items of a device's backups can be added only from that device, because the device lends its own key (the viewer says so). Exit 4 when some were added and some not. JSON: a command result. ```sh $ spacebackup --json photos add "Best of 2026" a~alb_7c21~Annas-iPhone~IMG_0412 {"ok":true,"partial":false,"message":"Cloned 1 item(s) of the album Chicago trip into the album Best of 2026 on OFFICE-NAS","error":null} ``` ### photos new-album ``` photos new-album [...] [--dest :]... ``` **New album**: `albums create`, kept on the `--dest` drives (the window's **Where it goes**; default every destination of `dest list`, as `photos copy-album`), then **Add to album** with the items given (none: an empty album). If the album was made but placing or adding failed, exit 4. ```sh $ spacebackup photos new-album "Best of 2026" a~alb_7c21~Annas-iPhone~IMG_0412 Made the album Best of 2026. Cloned 1 item(s) of the album Chicago trip into the album Best of 2026 on OFFICE-NAS ``` ### photos assistant ``` photos assistant ``` The assistant box: ask in plain words. The account service plans the answer; the command prints its sentence and what it shows (how many items match), or makes the album it was asked for. See [The assistant](04-ios.md#assistant). JSON: `say`, `show` (what to show: scope, place, dates, kind), `count`, `ids`, `album` (an album it made), `added`. ```sh $ spacebackup photos assistant "show me the videos from my last Chicago trip" Here are your videos from Chicago, October 2–5, 2026. 14 photo(s) and video(s) shown ``` ## Space Vision {#vision} The `vision` commands run on a computer that analyses the photos and videos of the phones' **Not encrypted** backups (Space Vision: an NVIDIA graphics card, the runtime and models installed with `vision install`). The full list is in `spacebackup help`; the two you need most: ### vision status ``` vision status [--machine M] ``` The worker (its graphics card(s), profile, and why it is not active) and, for each phone backed up here, how much is analysed. With several graphics cards, one line per card with its state: `working (16g)`, `ready (8g)` (it has room for that profile now), `ready: 16g by size, 8g fits now` (a 16g card whose free memory holds only 8g now), `waiting: GPU busy (…)` (another program holds the card's memory; tried again every 2 minutes), `excluded` (`vision gpus`) or `unusable` (too small or too old). JSON: `worker` (`active`, `why`, `profile`, `gpu`, `running`, `gpuSetting`, `gpuUsed`, `gpus[]` with `index`, `name`, `totalMb`, `freeMb`, `usedMb`, `state`, `plan`, `working`, `why`) and `machines[]`. ```sh $ spacebackup vision status Space Vision worker: GPU 0 NVIDIA GeForce RTX 3090 24 GB, GPU 1 NVIDIA GeForce RTX 3090 24 GB (16g, auto: from the graphics card), working on GPU 0 (…), GPU 1 (…) GPU 0 NVIDIA GeForce RTX 3090 24 GB, 4.4 of 24.0 GB free: working (8g) GPU 1 NVIDIA GeForce RTX 3090 24 GB, 2.0 of 24.0 GB free: working (16g) Annas-iPhone: 8120 of 9400 analysed, 9400 coloured; videos: 310 analysed, 290 transcribed; 1280 waiting; done by MARS-001 7900, DST-AI-3090 220; workers from other PCs: DST-AI-3090 (220 done, on 2026-10-20) ``` `done by` credits each worker (this PC's and other PCs') with the done items whose records it put back, counted from the stored records, so a restart of this PC does not reset them; `machines[].doneBy` in JSON. ### vision progress ``` vision progress [--machine M] [--here] ``` What the computers with a graphics card are doing, for the whole company (the apps show the same under Settings → Photo analysis): for photos, videos, transcripts, faces in photos and faces in videos how many are done of how many, failed, the rate over the last hour and about how long the rest takes; every computer's worker (working, idle, paused, busy with something else, Local AI off, no graphics card, not set up), its card and profile and what it works on now; and the last 10 runs with what each did and its errors. Every online computer is asked (its answer is kept a few seconds); `--machine` one phone; `--here` this computer only. `vision status` ends with this computer's part. Each kind ends with what it is doing in words: how many are left with the rate and the time left, **Done** (with what is never done, such as the videos without speech, which get no transcript), **Waiting:** and why (a computer busy with a backup, the graphics cards busy or paused, none on), or **Not moving in the last hour** while a computer that could take them stands idle. JSON: `kinds` (each `done`, `total`, `failed`, `skipped`, `left`, `lastHour`, `today`, `perMin`, `etaMin`, `status`, `say`), `workers[]` (`pc`, `state`, `why`, `profile`, `gpu`, `now`), `runs[]`, `pcs[]`. ```sh $ spacebackup vision progress Space Vision progress (MARS-001, CHIA2, MARS2) Photos analysed: 23,950 of 24,031 (99.6 %): 69 left · 5.17 a minute · about 13 min left, 2,210 today Videos analysed: 480 of 512 (93.7 %): 32 left · 0.33 a minute · about 1.6 h left, 96 today Videos transcribed: 210 of 480 (43.7 %): Done — 270 videos have no speech, 40 today Faces in photos: 24,031 of 24,031 (100 %): Done Faces in videos: 130 of 512 (25.3 %): Waiting: MARS2 works on other items first, 130 today CHIA2: no-gpu (no graphics card with 8 GB or more) MARS-001 (NVIDIA GeForce RTX 2080 SUPER 8 GB, 8g): idle (nothing queued) MARS2 (NVIDIA GeForce RTX 3090 24 GB, 16g): working: describing a photo, 96 of 300, CHIA2 Vlads-iPhone 2026-11-02 Recent runs: 2026-11-03T13:58:02Z MARS2 on CHIA2: Vlads-iPhone, 290 photo(s), 8 video(s), 3 transcript(s), 298 with faces looked at, 2 failed (cannot identify image file) ``` ### vision workers ``` vision workers [--here] ``` Every computer as a worker, for the whole company (the apps show the same under Settings → Photo analysis → Workers): each computer's graphics cards with how much of their memory is free and which models each would load, what it works on now, how many items a minute it did over the last hour and how many today, and for a computer that is not working why, in plain words: nothing to do, in use (its owner is at it), quiet hours, too hot, over the power cap, waiting for memory (a game or another program has the card), backing up, out of date, paused, joining (it installs the analysis by itself), or not a worker and why. The first line says how many work, on how many cards, items a minute, and how many items are left. `--here` this computer only. JSON: `workers[]` (`pc`, `state`, `cards[]` with `index`, `name`, `totalMb`, `freeMb`, `state`, `profile`; `freeMb`, `profile`, `now`, `perMin`, `lastHour`, `today`, `idle`, `idleSay`, `version`, `outOfDate`), `kinds`, `left`, `perMin`, `pcs[]`. ```sh $ spacebackup vision workers Workers: 2 of 5 working (3 card(s)), 12.4 items a minute, 2,340 item(s) left DST-AI-3090 (GPU 0 NVIDIA GeForce RTX 3090 24.0 GB, 11.5 free, 16g; GPU 1 NVIDIA GeForce RTX 3090 24.0 GB, 13.2 free, 16g): working: looking at and listening to videos of CHIA2 (3 of 40) · 7.2/min · 300 today mars-001 (NVIDIA GeForce RTX 2080 SUPER 8.0 GB, 0.7 free, 8g): working: describing photos of CHIA2 (96 of 300) · 5.2/min · 410 today mars2 (NVIDIA GeForce RTX 5070 Ti 16.0 GB, 14.6 free, 16g): PC in use (input 40 s ago; works again after 5 min without input) · 120 today CHIA3 (NVIDIA GeForce RTX 2060 6 GB): not a worker: its graphics card (NVIDIA GeForce RTX 2060 6 GB) has less than the 8 GB the analysis needs (or is older than an RTX 20) ``` A computer with a usable graphics card becomes a worker by itself: the first time there is work, it downloads the analysis (as `vision download` does; `vision ai off` says no). Videos go to the computers with the larger cards and photos to the smaller ones, several computers share one phone's photos at once, and the photos someone is looking at go first. ### vision owner ``` vision owner [--in-use |off] [--quiet-hours HH:MM-HH:MM|off] [--max-temp <°C>|off] [--max-power |off] ``` This computer's owner comes first: the worker steps back while someone uses the computer (until `--in-use` minutes without keyboard or mouse input; 5 by default, `off` works while in use; a Mac keeps its own rule, `vision idle`), in the quiet hours (local time, over midnight too), while a card is at or over the temperature cap (it works again 5 °C under it), and for 10 minutes after a card drew more than the power cap. A game or another program that needs the card always comes first (the 2 GB rule of `vision gpus`). It starts again by itself. Kept across restarts. Without an option: the rules and whether one holds the worker now. JSON: `inUseMin`, `quiet`, `maxTempC`, `maxPowerW`, `holding` (why it steps back now), `rule` (`in-use`, `quiet`, `hot`, `power`). ```sh $ spacebackup vision owner --quiet-hours 23:00-07:00 --max-temp 80 Space Vision owner rules: steps back while the PC is in use (works after 5 min without input); quiet hours 23:00-07:00; max temperature 80 °C; max power off now: not holding the worker ``` ### vision gpus ``` vision gpus [all|[,…]|none] ``` Which graphics cards analyse. `all` (the default) runs one worker per usable card, each with the largest profile its **free** memory fits at that moment (`16g`, else `8g` when the 8g models are installed, else it waits), and they share the work so no item is analysed twice. A card another program uses (2 GB or more, such as LM Studio or a game) keeps 1 GB free for that program, and the worker on it stops and gives its memory back when the card is nearly full. `0,1` or `1` uses only those cards (the numbers `nvidia-smi` shows); `none` uses none (colours only). Kept across restarts. Without an argument: the setting and each card's state. JSON: `setting`, `gpus[]` (as in `vision status`), `gpuUsed`, `why`. ```sh $ spacebackup vision gpus 1 Space Vision GPUs: 1 GPU 0 NVIDIA GeForce RTX 3090 24 GB, 11.5 of 24.0 GB free: excluded (vision gpus 1) GPU 1 NVIDIA GeForce RTX 3090 24 GB, 13.2 of 24.0 GB free: ready (16g) ``` ### vision idle ``` vision idle [|off] ``` A Mac only. A Mac you are using keeps 6 GB (on a 16 GB Mac; a quarter on larger ones) for your apps, and the worker waits while macOS reports memory pressure. After this many minutes without keyboard, mouse or trackpad input, or as soon as the lid is closed while the Mac is plugged in, the Mac counts as idle: your apps then keep 3 GB (an eighth on larger Macs) and pressure warning no longer holds the worker back. The worker stops within seconds of the first key press or mouse move, of critical memory pressure, or of unplugging the power. The default is 5 minutes; `off` never lets the Mac count as idle. Kept across restarts. Without an argument: the setting and what holds the worker now (`[rule: battery]`, `[rule: pressure]` or `[rule: reserve]`). ```sh $ spacebackup vision idle Space Vision idle mode: after 5 min without input, or with the lid closed on mains GPU 0 Apple M5 16 GB unified memory, 3.4 GB reclaimable, pressure warning, in use (6.0 GB kept for apps), 0.0 of 10.0 GB free: waiting: memory pressure warning (Apple M5, in use: no new batches until it is normal; idle after 5 min without input or with the lid closed: 3.0 GB kept) [rule: pressure] ``` ## Notifications {#notifications} The notification history of this computer: those from the account service (albums, shares, devices waiting for the key, new devices, restore approvals, relay credit, invitations accepted) and this computer's own warnings (a folder not backed up or missing, a drive full or missing, an update rolled back, a drive back and catching up). See [Notifications and history](06-notifications.md). `notifications` alone is `notifications list`. ### notifications list ``` notifications list [--unread] [--limit N] ``` Newest first. Ids are `s` (from the account service) or `l` (this computer's own). `*` marks unread; `(quiet)` marks a kind you turned off in your notification settings (kept, but not popped up). The last line is the unread count. | Option | Meaning | |---|---| | `--unread` | only the unread ones | | `--limit N` | at most N | JSON: `notifications` (each: `id`, `source` = `service` or `local`, `time`, `kind`, `title`, `body`, `target` = what it opens: `type`, `id`; `read`, `quiet`, `seq`), `unread`, `cursor`. Service kinds: `album-added`, `shared`, `key-waiting`, `device-joined`, `restore-approval`, `relay-credit`, `invitation-accepted`, `remove-request`. This computer's kinds: `folder-not-backed-up`, `folder-missing`, `drive-full`, `drive-missing`, `update-rolled-back`, `drive-back`. ```sh $ spacebackup notifications --limit 3 s1042 * 2026-10-18 13:05 New photos in Chicago trip: Bob added 6 photos. l17 * 2026-10-18 02:40 E:\ is missing: E:\ could not be reached, so nothing was backed up to it. Plug it in or switch it on; it catches up when it is back. s1039 2026-10-17 18:22 BOB-LAPTOP joined Acme: bob@acme.com added a device. (quiet) 2 unread ``` ### notifications read ``` notifications read ... | --all ``` Marks notifications read (clicking one in the list), or all of them (**Mark all as read**). Those from the account service are marked read at the service too, so your other devices and your iPhone follow. Unknown id: exit 1; neither ids nor `--all`: exit 2. ```powershell PS C:\> sbctl notifications read --all 2 marked read; 0 unread ``` ### notifications watch ``` notifications watch [--for D] ``` Prints each new notification as it arrives, one line each (with `--json`, one notification object per line), until Ctrl+C or `--for`. ```sh $ spacebackup --json notifications watch --for 1h {"id":"s1043","source":"service","time":"2026-10-18T18:30:12Z","kind":"key-waiting","title":"BOB-LAPTOP is waiting for the company key","body":"Approve it on the admin page.","target":{"type":"key-release","id":"kr_51…"},"read":false,"quiet":false,"seq":88} ``` ## Space Relay {#relay} Space Relay connects your company's computers at different sites. See [Space Relay](11-relay.md) and [Billing and prices](11-relay.md#billing). `relay` alone is `relay balance`. `relay balance` and `relay buy` need this computer to be signed in (else exit 1 `not signed in: sign in first: account signin `). ### relay balance ``` relay [balance] ``` The company's relay credit: the free traffic of this month (5 GB per company) and the prepaid credit (which never expires), then `Activation needed: …` when the free traffic is used and there is no credit, and the auto top-up. Sizes are in decimal GB (10^9 bytes, as the relay counts), always in GB. JSON: `month`, `freeBytes` (null = unlimited), `freeUsedBytes`, `prepaidBytes`, `activationNeeded`, `autoTopUp`, `autoTopUpPack`, `paymentsEnabled`, `line`. ```sh $ spacebackup relay Free this month: 3.2 / 5 GB · Prepaid: 87 GB Auto top-up: on (500 GB pack) ``` ### relay buy ``` relay buy [--open] ``` Prints a single-use link (valid 15 minutes) to the account page's buy screen, already signed in as this computer's email (500 GB $9 · 2 TB $25 · 5 TB $49; credit never expires). The link is alone on the first line; `--open` also opens it in your browser. JSON: `url`, `expiresUtc`, `opened` (null without `--open`). ```powershell PS C:\> sbctl relay buy https://spacebackup.net/account/buy?t=7HqP… (opens the buy screen signed in as this PC's email; single use, valid until 14:52) ``` ### relay activate ``` relay activate [--open] ``` **Activate Space Relay…** in Settings. Signed in: the same single-use buy link as `relay buy`. Not signed in: the page that activates Space Relay for this company (the `relay-activate-url` setting, set once this month's free relay traffic is used). Neither: exit 1. JSON as `relay buy` (`expiresUtc` null for the activation page). ```sh $ spacebackup relay activate --open https://spacebackup.net/account/relay/activate?group=QX7M2 (the page that activates Space Relay for this company) Opened in your browser. ``` ## Google Drive {#gdrive} Back up Google accounts (read-only). Each account is backed up by exactly one computer of the company at a time (its *worker*). See [Google Drive](03-backing-up.md#google-drive). `gdrive` alone is `gdrive list`. ### gdrive list ``` gdrive [list] ``` The Google accounts backed up in the company: the computer backing each up, size, last and next run, status, frequency, scope, destinations, and where the copies live. JSON (array): `email`, `worker`, `workerIsThisPc`, `sizeBytes`, `lastRun`, `nextRun`, `status`, `warning`, `frequency`, `scope`, `exportPdf`, `includeTrash`, `dest` (as `gdrive set … dest` takes it), `destMode`, `copies`, `selectedDestinations`, `where`, `destWarning`, `mirror` (the working copy, only on the worker), `lastResult`, `moveTo`. ```sh $ spacebackup gdrive anna@acme.com backed up by OFFICE-NAS OK size 14.2 GB, last run 2026-10-18 02:20, next 2026-10-19 02:20, frequency night, scope my-drive,shared-drives, destinations all copies: OFFICE-NAS:/srv/backup, ANNA-PC:E:\ ``` ### gdrive add ``` gdrive add [--no-browser] [--take-over] [--dest D] gdrive add --session --redirect '
' ``` Signs in to a Google account (read-only access) in the browser and backs it up from this computer. The command waits up to 10 minutes for the sign-in. | Option | Meaning | |---|---| | `--no-browser` | do not open a browser: print the address to open (also done without a display) | | `--take-over` | also when another computer backs this account up (else refused: `already backed up by OFFICE-NAS`) | | `--dest D` | its destinations once signed in (the window's destinations step); see [Destinations](#dest-values) | | `--session --redirect '
'` | finishing a sign-in made in a browser on another computer: after allowing access, that browser shows an `http://127.0.0.1:…` address that does not load; copy it and pass it here, with the session id the first command printed | ```sh $ spacebackup gdrive add --no-browser --dest auto:2 Open this address in a browser on this computer to sign in to Google: https://accounts.google.com/o/oauth2/v2/auth?… (Browser on another computer: after allowing access it shows an address starting with http://127.0.0.1 that does not load; copy it and run: spacebackup gdrive add --session 5d1e… --redirect '') Waiting for the sign-in… signed in as anna@acme.com; this PC backs it up (first run 2026-10-19 02:20, or now: gdrive now anna@acme.com). Fastest PC: gdrive speedtest anna@acme.com anna@acme.com: destinations auto:2 ``` ### gdrive remove ``` gdrive remove ``` Stops backing up the account. Its backups on the destinations are kept; the sign-in is dropped and revoked. ```sh $ spacebackup gdrive remove anna@acme.com anna@acme.com: no longer backed up; its backups on the destinations are kept ``` ### gdrive move ``` gdrive move --to [--no-browser] ``` Makes another computer back up the account: it takes over once someone signs in there. With `--to` this computer, it signs in here and takes over at once (the old worker drops its sign-in). ```powershell PS C:\> sbctl gdrive move anna@acme.com --to OFFICE-NAS anna@acme.com: OFFICE-NAS takes over once someone signs in there (on OFFICE-NAS: gdrive move anna@acme.com --to OFFICE-NAS, or Settings → Google Drive → Move here); this PC keeps backing it up until then ``` ### gdrive speedtest ``` gdrive speedtest ``` Run on the computer backing the account up: measures the download speed from Google Drive on every online computer (with a short-lived access token passed over the encrypted link between computers) and their free disk, and suggests the fastest one with enough disk (marked `*`). ```sh $ spacebackup gdrive speedtest anna@acme.com * OFFICE-NAS: 61.4 MB/s, 3120.6 GB free ANNA-PC (this PC): 22.8 MB/s, 812.4 GB free Suggested: OFFICE-NAS (gdrive move anna@acme.com --to OFFICE-NAS) ``` ### gdrive now ``` gdrive now [--wait] ``` Backs up the account now: its Drive run (only the changes after the first), then its copy to the destinations. Run it on the computer backing it up (else exit 1, naming that computer). Exit 4 when the Drive part did not fully succeed. ```sh $ spacebackup --json gdrive now anna@acme.com --wait {"ok":true,"partial":false,"message":"…","error":null} ``` ### gdrive set ``` gdrive set frequency|scope|export-pdf|include-trash|dest ``` | Setting | Values | |---|---| | `frequency` | `night` (default), `hourly`, `every:N`, `daily:HH:mm`, `weekly::HH:mm`, `manual` | | `scope` | a comma list of `my-drive`, `shared-drives`, `shared-with-me` (the next run lists the account again) | | `export-pdf` | `on`/`off`: also export Google Docs, Sheets and Slides as PDF | | `include-trash` | `on`/`off`: also back up the trash | | `dest` | `all`, `auto:N`, `selected:\|` | ```powershell PS C:\> sbctl gdrive set anna@acme.com frequency daily:22:00 anna@acme.com: frequency daily:22:00 ``` ## Updates {#updates} Automatic updates from spacebackup.net: every download is checked against a signed list before it is installed, a version is never downgraded, and it installs only when nothing is running. See [Automatic updates](03-backing-up.md#updates). The mode is the `updates` setting (`automatic`, `notify`, `off`). `update` alone is `update status`. Platform differences: Windows runs the new installer silently (and goes back to the old version if the new one does not start); a Linux `.tar.gz` or AppImage install replaces itself; a Linux `.deb` install only tells you the `sudo apt install ./spacebackup__amd64.deb` command; macOS replaces the whole app. All `update` commands answer with the same JSON: `mode`, `channel`, `current`, `latest`, `available`, `state` (`idle`, `checking`, `up-to-date`, `available`, `downloading`, `ready`, `waiting-idle`, `installing`, `held`, `error`, `unsupported`), `text`, `lastCheckUtc`, `nextCheckUtc`, `error`, `skipped`, `waitingSinceUtc`, `waitingFor` (state `waiting-idle`: what it waits for, e.g. "this PC's backup"), `updatedFrom`, `feedUrl`, `failedVersion`, `failedUtc`, `failedReason`, `failedText` (the last update that could not be completed on this computer; that version is tried again at most once a day, state `held`). ### update status ``` update [status] ``` Mode, current and latest version, state. ```powershell PS C:\> sbctl update up to date (0.12.1) mode automatic, channel stable, running 0.12.1, latest 0.12.1; last check 2026-10-18 08:02, next 2026-10-18 14:11 ``` ### update check ``` update check ``` Checks the signed update list now (in Automatic mode, also downloads and installs at the next idle moment). Exit 1 when the check failed. ```sh $ spacebackup update check 0.12.2 available (sbctl update now) mode notify, channel stable, running 0.12.1, latest 0.12.2; last check 2026-10-18 14:30, next 2026-10-18 20:41 ``` ### update now ``` update now ``` Downloads, verifies and installs the latest version now (also in Notify mode, and also a version held after a failure), as soon as no backup, restore or check of this computer is running; phones and computers merely browsing its photos do not hold it back. Exit 1 on an error. ```powershell PS C:\> sbctl update now 0.12.2 ready; waiting for this PC's backup to end (update now) mode automatic, channel stable, running 0.12.1, latest 0.12.2; last check 2026-10-18 14:31 ``` ### update skip ``` update skip ``` Notify mode: do not offer the available version again (a newer one will be offered). ```sh $ spacebackup update skip 0.12.2 will not be offered again (a newer version will) ``` ## Explorer integration (Windows) {#shell} **Windows only.** The Explorer badge is the Space Backup mark on backed-up folders in Explorer (Settings → **Explorer badge**). On macOS and Linux these commands answer `… is Windows only` with exit 1 (Linux: `integrate` adds the file manager menus and emblems; macOS: the Finder extension of the app). See [File manager badges and menus](03-backing-up.md#badges). `shell` alone is `shell status`. ### shell status ``` shell [status] ``` Whether the Explorer badge is installed and loaded. Exit 1 when it is not installed (or Windows gave it no overlay slot). ```powershell PS C:\> sbctl shell Explorer badge: on; it turns while a folder is backed up. (C:\Users\anna\AppData\Local\Programs\SpaceBackup\SpaceBackupShell.dll; 2 of 2 overlays got a slot) ``` ### shell install ``` shell install [--restart-explorer] ``` Installs the Explorer badge; Windows asks for administrator rights. `--restart-explorer` then restarts Explorer so the badge shows (the answer to the window's "Restart Explorer now?"); without it Explorer is not restarted and the badge appears after the next sign-in. ```powershell PS C:\> sbctl shell install --restart-explorer Explorer badge: installed; restart Explorer to show it. Explorer restarted ``` ### shell uninstall ``` shell uninstall [--restart-explorer] ``` Removes the Explorer badge (administrator rights); `--restart-explorer` as above. ```powershell PS C:\> sbctl shell uninstall Explorer badge removed. ``` ### shell restart-explorer ``` shell restart-explorer ``` Restarts Explorer so it shows (or stops showing) the badge. Open folder windows come back. ```powershell PS C:\> sbctl shell restart-explorer Explorer restarted ``` ## Linux and macOS only commands {#linux-only} These are handled by the `spacebackup` program itself and are not in `sbctl`. | Command | Linux | macOS | |---|---|---| | `daemon` | yes | yes | | `install [--no-start]`, `uninstall` | yes (systemd user service) | yes (LaunchAgent) | | `integrate`, `unintegrate` | yes | no: the app's Finder extension replaces it | | `gui [--window] [--restore ]` | yes | no: the menu-bar app replaces it | | `--port ` | yes | yes | ### daemon ``` daemon [--port ] ``` Runs the daemon in the foreground, printing its log (normally the systemd user service or the LaunchAgent runs it). Stop it with Ctrl+C. `--port `: the TCP port for other computers (default 47800; `0` = any free port, which `status` shows); it is saved in the settings. ```sh $ spacebackup --profile test daemon --port 0 14:02:11 Space Backup 0.12.1 for Linux started (/home/anna/.local/opt/spacebackup/spacebackup) as ANNA-LAPTOP-test; config /home/anna/.config/spacebackup/profiles/test, state /home/anna/.local/state/spacebackup/profiles/test … ``` ### install ``` install [--no-start] [--port ] ``` Linux: writes and enables the systemd user service `spacebackup.service` and starts it (`--no-start`: not now). On a `.deb` install the service is already enabled for every user; `install` turns it back on after `uninstall`. Run `sudo loginctl enable-linger $USER` once so it runs from boot without a login (`install` says so when needed). macOS: writes the LaunchAgent `~/Library/LaunchAgents/net.spacebackup.daemon.plist` and loads it: the daemon starts now and at every login, and again after a crash (not after `stop`). No administrator rights are needed. ```sh $ spacebackup install Wrote /home/anna/.config/systemd/user/spacebackup.service (runs /home/anna/.local/opt/spacebackup/spacebackup). Keep the binary there, or run install again after moving it. Enabled and started spacebackup.service (systemctl --user status spacebackup.service; logs: journalctl --user -u spacebackup.service). ``` On macOS: ```sh $ spacebackup install Wrote /Users/anna/Library/LaunchAgents/net.spacebackup.daemon.plist (runs /Applications/Space Backup.app/Contents/MacOS/spacebackup). Keep the program there, or run install again after moving it. Started net.spacebackup.daemon; it starts at every login (log: spacebackup log). ``` ### uninstall ``` uninstall ``` Stops and removes (Linux `.deb`: turns off for your user) the service or LaunchAgent. Settings, state and backups stay. ```sh $ spacebackup uninstall Stopped and removed spacebackup.service. Config (/home/anna/.config/spacebackup), state (/home/anna/.local/state/spacebackup) and all backups are kept. ``` ### integrate ``` integrate ``` **Linux only.** Adds the **Space Backup** right-click menus (**Add to Space Backup**, **Remove from Space Backup**, **Space Backup Now**, **Restore from Space Backup…**) to Nautilus, Nemo and Dolphin, and the emblem on backed-up folders. User-level and safe to run again. With Nautilus, run `nautilus -q` once to restart it. The menus run `spacebackup fm-action add|remove|now|restore `, which reports the result as a desktop notification. ```sh $ spacebackup integrate Nautilus: a Space Backup submenu and folder emblems (restart Nautilus once: nautilus -q). Backed-up folders carry the emblem-spacebackup emblem (gio metadata; shown by Nautilus and Nemo). ``` ### unintegrate ``` unintegrate ``` **Linux only.** Removes exactly what `integrate` added. ```sh $ spacebackup unintegrate File manager integration removed (menus, scripts, emblem icon, folder emblems). ``` ### gui ``` gui [--window] [--restore ] ``` **Linux only.** Starts the graphical app (`spacebackup-gui`) detached from the terminal: a tray icon, or a window when the desktop has no tray. `--window` forces the window. `--restore ` opens **Restore…** preset to that path (in the running app if there is one). Only one per user; a second `gui` shows the running one's window. It prints nothing when it started; `spacebackup-gui not found next to …` (exit 1) when the graphical app is not installed (set `SPACEBACKUP_GUI` to its path if it lives elsewhere). ```sh $ spacebackup gui --restore ~/Documents/Reports $ echo $? 0 ``` ## Checks, log, firewall, version and help {#maintenance} ### scrub ``` scrub [--now] [--status] ``` The integrity check of this computer's destinations: each backed-up file is read again and compared with the manifest; a damaged file is repaired from a good copy. It runs in the night window as the `scrub` setting says (`weekly`, `monthly`, `off`). Without options, or with `--status`, it shows the state per destination; `--now` starts a check now. JSON: `running`, `destinations` (each: `root`, `lastCheckUtc`, `filesOk`, `repaired`, `damaged`, `text`). ```powershell PS C:\> sbctl scrub no check running E:\SpaceBackup: last check 2026-10-12 03:10, 146,402 files OK, 0 repaired ``` ### log ``` log [--tail N] [--follow [--for D]] ``` The app log: the last `N` lines (default 40); `--follow` keeps printing new lines. Where the file is: Windows `%APPDATA%\SpaceBackup\log.txt`; Linux `~/.local/state/spacebackup/log.txt` (also in the journal: `journalctl --user -u spacebackup`); macOS `~/Library/Application Support/SpaceBackup`. See [Logs per platform](13-troubleshooting.md#logs). JSON: `lines`, `cursor`, `path`; with `--follow`, one line (a JSON string) per line. ```sh $ spacebackup log --tail 2 2026-10-18 14:19:07 Peer OFFICE-NAS runs 0.12.2 (this PC 0.12.1): checking for an update now 2026-10-18 14:19:09 Rearrange: rearranged 412 items to OFFICE-NAS:/srv/backup ``` ### firewall ``` firewall [--check] [--allow] [--allowed] ``` Lets the other computers reach this one (TCP 47800 and UDP 47801). See [Firewall and ports](13-troubleshooting.md#firewall). - **Windows:** `firewall` (or `firewall --allow`) adds the Windows Firewall rules. It needs administrator rights: run it in an elevated PowerShell (exit 5 otherwise), or use **Open Space Backup** → Settings → This PC → **Allow through Windows Firewall…**. `--check` says whether the rules are there. - **Linux:** `firewall` prints the exact `sudo ufw allow …` (or `firewall-cmd …`) commands for the active firewall. `--allow` runs them now, as the main window's **Allow** does: as root, or with `sudo -n` (exit 5 when sudo would ask for a password), and then remembers it. `--allowed` only tells Space Backup the rules were added (they cannot be read without root). `--check` exits 1 when the rules are not known to be there. `status --json` has `firewallClosed`. - **macOS:** nothing to add: when the macOS firewall is on, it asks you once whether Space Backup may accept incoming connections. `firewall` says so (exit 0). JSON: `allowed`, `port`, `discoveryPort`, `text`, and on Linux `kind` (`ufw`, `firewalld`) and `allowCommand`. ```sh $ spacebackup firewall --allow adding the firewall rules needs root: sudo asks for a password here. Run as root (or with sudo), or: ufw allow 47800/tcp … $ echo $? 5 ``` ### version ``` version ``` The app's version, the platform, the peer protocol version, and the command line's own; works without the app running. JSON: `app`, `platform`, `protocol`, `daemon`, `updatedFrom`, `cli`, `running`, `updatedUtc`. ```powershell PS C:\> sbctl version Space Backup 0.12.1 (windows), peer protocol v0.5; sbctl 0.12.1 ``` ```sh $ spacebackup version Space Backup 0.12.1 for Linux; daemon 0.12.1; protocol v0.5 ``` ### help ``` help [] ``` All commands with one line each, or one command's synopsis, description and options. `help settings set` also lists every setting key. On Linux and macOS the list ends with the platform's own commands. ```sh $ spacebackup help cancel spacebackup cancel [--restore] cancel the running backup (it is not resumed); --restore: stop the restores running now instead (the files restored so far stay) --restore: stop running restores (the Restore window's Stop), not the backup ``` ## Transaction log and diagnostics commands {#visibility} Besides the human-readable app log, every computer keeps a **transaction log**: one record per operation (a file copied, a hard link batch, a verification, a prune, a restored file, a connection to another computer, an update…). These commands let you see exactly what Space Backup did and why, and are what support asks for. All of them take `--json` (streams: one JSON object per line). Where it is kept: `%APPDATA%\SpaceBackup\txlog\` on Windows, `~/.local/state/spacebackup/txlog/` on Linux, the `txlog` folder in `~/Library/Application Support/SpaceBackup` on macOS. One file per day (`tx-YYYY-MM-DD.jsonl`), compressed after 7 days and kept 90 days (the `txlog-days` setting); runs in `runs-YYYY-MM.jsonl`, events in `events.jsonl`. A computer also logs what it did for other computers (files it received, copies passed on, prunes), marked `onBehalfOf`. To keep the log small for big folders, unchanged files are not recorded one by one: hard links of unchanged files are one `link` record per batch, files already in today's folder one `skip-unchanged` record per folder and destination, and a folder's scan one `scan` record. Every file copied (new or changed), every failure, retry, resume, fan-out copy, prune, repair and restored file has its own record. ### Record kinds {#tx-kinds} | Kind | Meaning | |---|---| | `scan` | a folder was scanned (files and bytes) | | `copy` | a file was copied, new or changed (with its hash and duration); a failed or skipped file is a `copy` with result `fail` | | `link` | a batch of unchanged files hard-linked from the previous date (`files` = how many, `source` = the folder) | | `skip-unchanged` | files already in today's folder, per folder and destination | | `verify` / `verify-fail` | a copy was read back and checked / failed the check (it is redone) | | `retry` | an operation was tried again | | `resume` | an interrupted copy was continued | | `fan-out` | a copy passed on from one destination to another | | `prune` | an old date folder was removed (`max-backups`) | | `scrub-ok` / `scrub-repair` | the integrity check found a file good / repaired it | | `restore` | a file was restored | | `error` | an error not tied to one file | | `peer-connect` / `peer-disconnect` | a connection to another computer opened / closed | | `update` | an update was installed (or rolled back) | | `gdrive-sync`, `gdrive-download`, `gdrive-export`, `gdrive-move`, `gdrive-delete`, `gdrive-unsupported`, `gdrive-assign` | Google Drive: one Drive run of an account, and its files; `source` is `gdrive:/` | A record's JSON fields: `seq` (order, for following), `ts`, `runId`, `kind`, `source`, `dest` (destination id), `destPath`, `peer` (the other computer, if remote), `bytes`, `files` (for grouped records), `hash` (XXH128 in hex, as in the manifests), `durationMs`, `result` (`ok` or `fail`), `error`, `onBehalfOf`. ### tx ``` tx [--run ID] [--since T] [--until T] [--kind K]... [--path GLOB] [--dest ID] [--result ok|fail] [--limit N] [--follow [--for D]] ``` Queries the transaction log. Default: the newest 100 records; with `--run`, all of that run. | Option | Meaning | |---|---| | `--run ID` | only one run (`last` = the newest run) | | `--since T`, `--until T` | a time range (see [Times](#times)) | | `--kind K` | (repeatable) only these kinds | | `--path GLOB` | only these paths: `*` and `?` as wildcards, case-insensitive, `\` and `/` alike; a path without wildcards matches everything under it | | `--dest ID` | only this destination | | `--result ok\|fail` | only successes or failures | | `--limit N` | at most N records (`0`: no limit) | | `--follow` | then keep printing new records live (`--for` to stop) | JSON: `records`, `cursor`, `truncated`; with `--follow`, one record per line. ```sh $ spacebackup tx --result fail --since 7d 2026-10-16 02:21:44 copy FAIL /home/anna/Documents/locked.pst -> OFFICE-NAS:/srv/backup: The process cannot access the file because it is being used by another process. [run 4b7e90c1a2d34f6e8b0c1d2e3f4a5b6c] ``` ### runs list ``` runs [list] [--since T] [--folder P] [--limit N] ``` Every backup run: id, start and end, trigger, result, files and bytes copied, linked, unchanged, skipped and failed, verification retries, number of destinations. Default: the newest 50. Triggers: `schedule`, `catch-up` (a drive or computer came back), `drive-back` (a drive came back), `peer-back` (another computer or its drive came back online), `now`, `selection` (chosen files and folders), `resume` (an interrupted run continued), `queued`, `command`. Results: `running`, `ok`, `warning`, `error`, `cancelled`. JSON (array): see [runs show](#runs-show) (`perDestination`, `slowest` and `failed` are empty in the list). ```powershell PS C:\> sbctl runs --limit 2 9f3c2a71e0b84d5c9a1e6f2b7c8d0e11 2026-10-18 14:15 -> 14:19 now ok 226 copied (1.21 GB), 12194 linked, 0 unchanged, 0 skipped, 0 failed; 2 destination(s) 4b7e90c1a2d34f6e8b0c1d2e3f4a5b6c 2026-10-18 02:14 -> 02:31 schedule warning 61 copied (212.70 MB), 3847 linked, 0 unchanged, 1 skipped, 1 failed; 2 destination(s) ``` ### runs show {#runs-show} ``` runs show |last ``` One run in full: the reason and date folder, folders and items, summary, the result per destination, the slowest and the failed items, errors. `last` is the newest run; an id prefix of 4 or more characters works. Unknown id: exit 1. JSON: `id`, `resumeOf`, `trigger`, `reason`, `date`, `startedUtc`, `finishedUtc`, `folders`, `items`, `destinations`, `filesCopied`, `filesUpdated`, `filesLinked`, `filesUnchanged`, `filesSkipped`, `filesFailed`, `filesRemoved`, `bytesCopied`, `bytesResumed`, `verifyRetries`, `fannedOut`, `result`, `summary`, `errors`, `perDestination` (each: `dest`, `result` = `ok`/`incomplete`/`missing`/`failed`, `files`, `bytes`, `linked`, `errors`, `avgMBps`), `slowest` and `failed` (transaction records). ```sh $ spacebackup runs show 4b7e 4b7e90c1a2d34f6e8b0c1d2e3f4a5b6c 2026-10-18 02:14 -> 02:31 schedule warning 61 copied (212.70 MB), 3847 linked, 0 unchanged, 1 skipped, 1 failed; 2 destination(s) reason: scheduled; date folder 2026-10-18 folders: /home/anna/Documents; /home/anna/Pictures summary: 57 new, 4 changed, 3847 unchanged (linked), 212.7 MB; 1 skipped; 1 errors ANNA-LAPTOP:/media/anna/Backup: ok, 61 copied (212.70 MB, 88.2 MB/s), 3,847 linked, 0 error(s) OFFICE-NAS:/srv/backup: ok, 60 copied (211.10 MB, 41.5 MB/s), 3,847 linked, 1 error(s) failed: copy /home/anna/Documents/locked.pst -> OFFICE-NAS:/srv/backup: The process cannot access the file because it is being used by another process. ``` ### transfers ``` transfers ``` What is moving right now: kind (`backup`, `fan-out`, `serving` = another computer's backup arriving here, `restore`), file, from and to, bytes done of total, speed, time left. JSON (array): `kind`, `file`, `from`, `to`, `bytesDone`, `bytesTotal`, `files` (a batch of small files), `speedMBps`, `etaSeconds`, `startedUtc`. ```powershell PS C:\> sbctl transfers backup: D:\Projects\video\final.mp4 ANNA-PC -> OFFICE-NAS:/srv/backup 1.12 GB of 3.40 GB, 41.2 MB/s, ETA 00:00:57 ``` ### queue ``` queue ``` Pending work: the next scheduled run of each folder (marked `(retry)` when the last run found every destination offline, `(catch-up)` for a catch-up), a run queued while another runs, selections waiting, interrupted runs to resume, the fan-out backlog per destination, the integrity check, an update waiting. JSON: `scheduled` (each: `folder`, `nextRun`, `text`, `catchUp`, `retry`), `queuedRun`, `queuedItems`, `resumePending`, `fanOut` (each: `dest`, `files`, `bytes`), `scrub` (`running`, `current`, `fraction`, `due`), `update`. ```sh $ spacebackup queue /home/anna/Documents: 2026-10-19 02:14 /home/anna/Pictures: 2026-10-19 02:14 (retry) fan-out to OFFICE-NAS:/srv/backup: 214 file(s), 1.18 GB check: not due ``` ### stats ``` stats [--days N] ``` Per destination and per other computer, over the last N days (default 7, 1–3650): files and bytes, average speed, errors, how often it was online; per computer the bytes sent and received and connections; the relay traffic. JSON: `days`, `sinceUtc`, `destinations` (each: `dest`, `files`, `bytes`, `linked`, `avgMBps`, `errors`, `onlinePercent`), `peers` (each: `peer`, `bytesOut` = this computer's backups sent there, `filesOut`, `bytesIn` = its backups received here, `filesIn`, `errors`, `connects`), `runs`, `runsFailed`, `relay` (as in `status`). ```powershell PS C:\> sbctl stats --days 30 last 30 day(s): 31 run(s), 2 with errors ANNA-PC:E:\: 8,412 files, 41.20 GB, 132.4 MB/s, 3,512,004 linked, 0 error(s), online 97% OFFICE-NAS:/srv/backup: 8,398 files, 41.12 GB, 44.8 MB/s, 3,511,870 linked, 3 error(s), online 100% peer OFFICE-NAS: out 41.12 GB (8,398 files), in 0 B (0 files), 3 error(s), 62 connection(s) ``` ### events ``` events [--follow [--for D]] [--since T] [--limit N] ``` The high-level event stream: the app starting and stopping, state changes, warnings, computers coming online and going offline, runs starting and ending, checks, updates, setting changes, folders, destinations and key changes. Default: the newest 50. Kinds: `app-start`, `app-stop`, `state`, `warning`, `peer-up`, `peer-down`, `run-start`, `run-end`, `scrub-start`, `scrub-end`, `update`, `setting`, `folder`, `destination`, `key` (and others such as `run-cancel`, `restore`, `albums`). Levels: `info`, `warning`, `error`. JSON: `events` (each: `seq`, `ts`, `kind`, `level`, `text`), `cursor`; with `--follow`, one event per line. ```sh $ spacebackup events --limit 3 2026-10-18 14:15:02 info run-start backup started (command): 2 folder(s) 2026-10-18 14:19:07 info run-end backup finished: ok: 226 new, 12 changed, 12194 unchanged (linked), 1240.5 MB [run 9f3c2a71e0b84d5c9a1e6f2b7c8d0e11] 2026-10-18 14:20:31 warning peer-down ANNA-PC offline (relayed, 0.12.1) ``` ### explain ``` explain ``` Everything known about one file or folder: which backed-up folder covers it, its schedule and destinations, every destination and date that holds it (with hash and status), the last copy and verification, the last integrity check of its destination, and why it was or was not copied in the last run. `lastRunAction` is one of `copied`, `updated`, `linked`, `unchanged`, `skipped`, `failed`, `not-in-run`, `never`. A copy's `status` is `ok`, `damaged` or `unverified` (not in the manifest yet). JSON: `path`, `exists`, `isDirectory`, `size`, `mtimeUtc`, `folder`, `frequency`, `nextRun`, `destinationsMode`, `targets`, `copies` (each: `dest`, `date`, `path`, `size`, `mtimeUtc`, `hash`, `status`, `incomplete`), `lastCopy`, `lastVerify` (transaction records), `lastScrubUtc`, `lastRunId`, `lastRunAction`, `why`, `notes`. ```powershell PS C:\> sbctl explain D:\Projects\plan.docx D:\Projects\plan.docx: file, 310.4 KB, modified 2026-10-02 09:15 covered by D:\Projects: frequency weekly, next run 2026-10-25 02:41, destinations auto:2 goes to: ANNA-PC:E:\; OFFICE-NAS:/srv/backup last run: linked (run 9f3c2a71e0b84d5c9a1e6f2b7c8d0e11): unchanged since the previous backup (same size and modification time): hard-linked into the new date folder instead of copied copies: 2 2026-10-18 ANNA-PC:E:\: ok, 310.4 KB, xxh128 5b0d… E:\SpaceBackup\ANNA-PC\2026-10-18\D\Projects\plan.docx 2026-10-18 OFFICE-NAS:/srv/backup: ok, 310.4 KB, xxh128 5b0d… /srv/backup/SpaceBackup/ANNA-PC/2026-10-18/D/Projects/plan.docx ``` ### diag ``` diag [--out ] ``` Writes a diagnostic bundle for support: the settings with secrets removed, the recent app log and transaction log, versions, other computers, destinations, disk information and firewall state. The company key and the relay token are never in it. `--out` chooses the file. See [Diagnostic bundle](13-troubleshooting.md#diagnostic-bundle). JSON: `path`, `bytes`, `files`. ```sh $ spacebackup diag --out ~/spacebackup-diag.zip diagnostic bundle written: /home/anna/spacebackup-diag.zip (2.4 MB, 14 files; the company key and relay token are not in it) ```