backdot 1.8.4 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="logo-small.png" alt="backdot" width="400" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">backdot</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">Automated backup of important files (configs, dotfiles) to your own private Git repo.</p>
|
|
8
|
+
|
|
9
|
+
## Getting started
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g backdot
|
|
13
|
+
backdot init
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This creates `~/.backdot/config.json` with sensible defaults and walks you through setup. Open the config file and set your repository URL and the files you want backed up:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"repository": "git@github.com:USERNAME/backdot-backup.git",
|
|
21
|
+
"machine": "my-work-laptop",
|
|
22
|
+
"paths": ["~/.zshrc", "~/.oh-my-zsh/custom/*.zsh", "~/.ssh/config", "~/.npmrc"]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Run your first backup:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
backdot backup
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
or configure the backport process to run automatically (daily at 2am)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
backdot schedule
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
| Key | Description |
|
|
41
|
+
| ------- | ----------------------------------------------------------------------------------------------- |
|
|
42
|
+
| `paths` | Glob patterns matching files. To back up a whole directory, use a trailing `/**` (e.g. `~/.config/nvim/**`) — a bare directory path matches nothing. |
|
|
43
|
+
|
|
44
|
+
Prefix a pattern with `!` to exclude matching files:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"paths": ["~/.config/ghostty/**", "!~/.config/ghostty/crash-reports/**"]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Encryption
|
|
53
|
+
|
|
54
|
+
To encrypt files before they are pushed to the remote repo, add `"encrypt": true` to your config.
|
|
55
|
+
|
|
56
|
+
On first backup you'll be prompted for a password and offered to save it to `~/.backdot/encryption.key` so that future backups do not prompt for a password.
|
|
57
|
+
|
|
58
|
+
For non-interactive backups (the scheduled job, CI, etc.) you can supply the password via the `BACKDOT_PASSWORD` environment variable instead of the key file.
|
|
59
|
+
|
|
60
|
+
## Post-restore hook
|
|
61
|
+
|
|
62
|
+
Add a `~/.backdot/post-restore` shell script which will be executed after `backdot restore`to install packages, clone repos, etc. It's backed up automatically.
|
|
63
|
+
|
|
64
|
+
## Commands
|
|
65
|
+
|
|
66
|
+
| Command | Description |
|
|
67
|
+
| ------------------------------ | ---------------------------------------------- |
|
|
68
|
+
| `init` | Set up backdot for the first time |
|
|
69
|
+
| `backup` | Run a backup now |
|
|
70
|
+
| `restore` | Restore latest backup from the configured repo |
|
|
71
|
+
| `restore <url>` | Restore from a specific repo URL |
|
|
72
|
+
| `restore [url] --commit <sha>` | Restore from a specific backup commit |
|
|
73
|
+
| `restore [url] --machine <name>` | Restore a specific machine non-interactively |
|
|
74
|
+
| `restore [url] --yes` (`-y`) | Restore new files non-interactively (skips existing files) |
|
|
75
|
+
| `history [url]` | Browse and restore a previous backup |
|
|
76
|
+
| `schedule` | Schedule automatic daily backup (Mac-only) |
|
|
77
|
+
| `unschedule` | Unschedule the daily backup |
|
|
78
|
+
| `status` | Show schedule and resolved file list |
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm install
|
|
84
|
+
npm run build
|
|
85
|
+
npm start
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backdot",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "Lightweight CLI to backup dotfiles and gitignored files to a Git repo on a daily schedule",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"fmt:check": "prettier --check src/",
|
|
31
31
|
"lint": "eslint src/",
|
|
32
32
|
"lint:fix": "eslint src/ --fix",
|
|
33
|
-
"prepare": "
|
|
33
|
+
"prepare": "husky",
|
|
34
34
|
"start": "node dist/cli.js",
|
|
35
35
|
"test": "vitest run --exclude src/e2e.test.ts --exclude src/git.integration.test.ts",
|
|
36
36
|
"test:all": "npm run build && vitest run",
|