From d5d4ea2430f45c610d376deefb4e9428fa32142edd5e779f9c3205be99ee7218 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Mon, 24 Aug 2026 00:53:49 +0200 Subject: [PATCH] change README.md --- README.md | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 7e2b61a..ca8d81b 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,6 @@ curl -fsSL https://git.ccc-rheintal.ch/spacefreak/pbc/raw/branch/master/install. This installs the newest tagged version to `/usr/local/bin/pbc`, installs the dependencies, and puts an example config at `/etc/pbc/config.example`. -From a clone: - -```bash -sudo ./pbc install # install the dependencies, then copy pbc where you want it -``` - -`install.sh` always fetches the newest tagged release from the repository, so running it -from a clone does not install your local copy. - ### Updating Run the same command again to update `pbc` itself: @@ -198,24 +189,44 @@ filesystem and mark what you want back: ``` pxar:/ > cd etc pxar:/etc > ls -pxar:/etc > select nginx -pxar:/etc > cd ../home/user -pxar:/home/user > select .ssh/config -pxar:/home/user > list-selected -pxar:/home/user > restore-selected /mnt/restore -pxar:/home/user > exit +pxar:/etc > select hosts +pxar:/etc > find etc/nginx/** --select +pxar:/etc > list-selected +pxar:/etc > restore-selected /mnt/restore +pxar:/etc > exit ``` -- `ls`, `cd`, `pwd`, `stat`, `find` — browse the archive -- `select` / `deselect` — mark a file or directory for restore +- `ls`, `cd`, `pwd`, `stat` — browse the archive +- `select ` — mark a single file, relative to the current directory +- `find --select` — mark everything matching a glob +- `deselect ` / `clear-selected` — drop one entry or all of them - `list-selected` — show what is currently marked - `restore-selected ` — restore only the marked entries -- `restore ` — restore the whole archive +- `restore [pattern]` — restore the current directory and everything below it - `help` — list all available shell commands - `exit` — leave the shell -Create the target directory beforehand — `pbc` does not create it. It has to be writable -for the user that runs `pbc`, and should be empty. +#### Selecting a directory and everything beneath it + +`select` marks exactly the entry you give it and nothing else. Marking a directory +therefore restores an empty directory — its contents are *not* included. Use a glob with +`find --select` instead: + +``` +pxar:/ > find etc/nginx/** --select +pxar:/ > select etc/nginx +pxar:/ > restore-selected /mnt/restore +``` + +The `find` line picks up everything below `etc/nginx`; the `select` line adds the +directory itself, so its own permissions and ownership are restored as well. + +Note that `find` patterns are always matched against paths relative to the archive root, +no matter which directory you are in, and that `find` scans the whole archive — expect it +to take a while on large backups. + +The target path must not exist yet; the restore creates it. Its parent directory has to be +writable for the user that runs `pbc`. ### Everything, or with normal tools