Expand description
The workspace backup: frequent snapshots of Work/ in a git folder of its own under
Backup/, and bringing the workspace or one file back from any of them.
Workspaces/<workspace>/
Backup/
Code.git/ the snapshots, git's own folder with no working tree
Assets.git/ the snapshots of `Assets/`, when the workspace asks for them
backup.lock held while a snapshot or a restore of the workspace runs
assets.lock held while one of `Assets/` runsThe backup sits beside the workspace, so it moves and is copied with it. It guards against a wrong delete, a change that breaks things and a harness scattering files, not against a failing disk.
git does not run on the machine: QCode promises to run no program there, and the machine may
have no git. Every job runs in a one-off container of the base image that sees the workspace
and Backup/ and removes itself when git is done (the job module has the commands). The person’s
own repository inside Work/, if there is one, is never touched: the backup has a git
folder of its own, and git never takes a folder called .git into a snapshot.
Everything public here runs engine commands and waits for them, so it belongs on a background thread.
Modules§
- conversations
- The conversations backup: each profile’s conversations in a workspace, kept apart from the workspace’s own backup and brought back from any snapshot.
Structs§
- BadPlace
- A path that was refused, with why.
- Entry
- One snapshot in the list.
- Place
- A path inside
Work/, checked, with/between its parts and no/at either end. - Snapshot
Id - The id of one snapshot: git’s commit id, in full.
Enums§
- Backup
Error - Why a backup job did not do what was asked.
- Backup
Every - How often an open workspace is backed up.
- Place
Problem - Why a path is not a place inside the workspace.
- Reason
- Why a snapshot was taken, kept as its commit message so the list can say it.
- Restored
- What
restoreandrestore_filedid. - Snapshot
- What one round of
snapshotdid.
Functions§
- assets_
history - The snapshots of
Assets/, newest first. Assets never backed up have none, and no container is started to say so. - history
- The snapshots of the workspace, newest first; those that changed
filewhen one is named. A workspace that has never been backed up has none, and no container is started to say so. - restore
- Brings every file of the snapshot
idback into the workspace, after a snapshot of how the workspace is now. - restore_
assets - Brings every file of the snapshot
idback intoAssets/, after a snapshot of how it is now. Nothing is deleted, as inrestore; a folder that is gone is made again to hold them. - restore_
file - Brings
fileback as it was in the snapshotid, after a snapshot of how the workspace is now. The rest of the workspace is left as it is. - size
- How much
Backup/holds on the disk, in bytes: every file under it, each counted once. A workspace never backed up holds nothing. A file that goes while it is counted is not counted; a symbolic link counts as itself, never as what it points to. - snapshot
- Backs the workspace up, leaving out every folder or file of
skipas well as what the workspace’s own.gitignoreleaves out. - snapshot_
assets - Backs
Assets/up, into a git folder of its own. A workspace without the folder has nothing to back up, and no container is started to say so.