https://github.com/akornatskyy/backscribe
π Backup + scribe (a shell script writer).
https://github.com/akornatskyy/backscribe
backup-script shell
Last synced: 4 months ago
JSON representation
π Backup + scribe (a shell script writer).
- Host: GitHub
- URL: https://github.com/akornatskyy/backscribe
- Owner: akornatskyy
- License: mit
- Created: 2025-09-10T11:37:26.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-10-22T07:48:54.000Z (8 months ago)
- Last Synced: 2025-10-22T09:31:17.282Z (8 months ago)
- Topics: backup-script, shell
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# backscribe
[](https://github.com/akornatskyy/backscribe/actions/workflows/tests.yml)
*Backscribe* is a flexible command generator for archiving, copying, and backing up files, driven by structured configuration definitions. It outputs a series of shell commands that you can review or pipe directly into your shell (e.g., via `sh` or `bash`).
## Usage
```text
Usage:
backscribe [options]
Description:
backscribe generates a sequence of shell commands based on a configuration.
If no configuration file is specified, it searches upward from the current
directory for a file named '[.]backscribe.(yaml|json)'.
Also checks $HOME and $HOME/.config
Options:
-c, --config Optional path to a config file
-h, --help Show this help message
-v, --version Show version
Examples:
backscribe -c ./config/backscribe.yaml | sh
backscribe | sh # Auto-searches for config
```
## Prerequisites
The 7z ([7-Zip](https://sourceforge.net/projects/sevenzip/files/7-Zip/)) command-line tool must be installed and discoverable in your systemβs PATH. You should be able to run 7z from any terminal or shell without specifying its full path.
## Behavior
If no config is specified, `backscribe` searches upward from the current directory for:
- backscribe.{yaml,yml,json}
- .backscribe.{yaml,yml,json}
It also checks `$HOME` and `$HOME/.config` directories.
## Configuration Format
Your configuration defines groups of file operations. Each group contains archives that describe what to back up or copy.
Archive Types:
- 7z: Create a .7z archive
- tar: Create a .tar archive
- cp: Copy files directly
## Example Configs
β
YAML
```yaml
groups:
- name: home
archives:
- type: 7z
name: dotfiles
files:
- ~/.*
exclude:
- .cache
```
β
JSON
```json
{
"groups": [
{
"name": "home",
"archives": [
{
"type": "7z",
"name": "dotfiles",
"files": ["~/.*"],
"exclude": [".cache"]
}
]
}
]
}
```
## Environment Variable Expansion
You can use environment variables in paths, like:
```yaml
groups:
- name: roaming
archives:
- type: 7z
name: Roaming
files:
- ${APPDATA}/Code
```
## Visual Studio Code
See `.vscode/settings.json` for enabling schema validation, auto-completion, and hover tooltips with documentation for *backscribe* files.
## Building from Source
```sh
git clone https://github.com/akornatskyy/backscribe.git
cd backscribe
go build
```