joplin-plugin-incremental-backup 1.0.2 → 1.0.4

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 CHANGED
@@ -12,7 +12,7 @@ Each snapshot is a complete, self-contained copy of your data. Consecutive snaps
12
12
  - **Deduplication** — files that are byte-identical to the previous snapshot are stored as hardlinks instead of copies. Changed and new files are stored normally, so every snapshot remains complete on its own.
13
13
  - **Content-addressed matching** — files are matched by SHA-256 hash, so even renamed or moved notes don't consume extra space.
14
14
  - **Retention pruning** — keeps a configurable number of snapshots (default: 5) and automatically deletes the oldest ones. Deleting an old snapshot never damages newer ones, because hardlinked files are only removed when no snapshot references them.
15
- - **Skip unchanged backups** — if no note has been modified since the last snapshot, the backup is skipped entirely (can be disabled).
15
+ - **Skip unchanged backups** — if nothing has changed since the last snapshot (notes, attachments, notebooks, tags, or which notes carry which tags), the backup is skipped entirely (can be disabled).
16
16
  - **Integrity verification** — every snapshot includes a `manifest.json` with the size and SHA-256 hash of every file. A verify command re-checks the whole snapshot and reports any missing or corrupted files.
17
17
  - **Crash-safe** — each backup run stages its files in a unique temporary directory (e.g. `_joplin_active_20261021T090000_12345_abcdef`) that is atomically renamed into place when complete. An exclusive lock prevents overlapping runs; the lock's mtime is refreshed periodically so a long export is never mistaken for an abandoned one. Stale locks are recovered atomically (rename-steal), and leftover staging data is cleaned up on startup unless another backup holds a fresh lock.
18
18
  - **Disk-space pre-flight** — checks available space before starting a backup and aborts the run if the backup drive is below the minimum free-space threshold, so a full disk can't produce a truncated snapshot. (If free space can't be measured on a platform, the backup proceeds with a warning.)
@@ -21,7 +21,6 @@ Each snapshot is a complete, self-contained copy of your data. Consecutive snaps
21
21
  - **Copy-mode warning** — if a previous snapshot exists but the filesystem doesn't support hardlinks (so every file had to be copied), a warning is shown so you know each snapshot consumes the full vault size.
22
22
  - **Durable metadata** — `manifest.json` and `latest.txt` are fsynced before and after the atomic rename, and a best-effort directory fsync is attempted so a power cut can't corrupt the snapshot index. Exported files themselves are left to OS writeback; fsyncing 20 k files per backup would be prohibitive.
23
23
 
24
-
25
24
  ## How to use
26
25
 
27
26
  1. Install the plugin and open **Tools > Options > Incremental Backup**.
@@ -45,6 +44,7 @@ Each snapshot is a complete, self-contained copy of your data. Consecutive snaps
45
44
  ├── 20261021T090000/ ← next snapshot (unchanged files hardlinked)
46
45
  ├── _joplin_active_20261021T090000_12345_abcdef/ ← staging dir (only while running)
47
46
  ├── latest.txt ← name of the newest snapshot
47
+ ├── .joplin-incremental-backup ← marker: this is a backup directory
48
48
  └── .backup.lock ← present only while a backup is running
49
49
  ```
50
50
 
@@ -52,6 +52,14 @@ Notes, notebooks, tags and note-tags are each written as a single `<id>.md` file
52
52
 
53
53
  The staging directory is unique per run (embedding the start time, process id, and a random suffix) so two concurrent runs can never write into the same directory. On startup, any leftover staging directories older than the stale-lock threshold are cleaned up — unless another Joplin instance holds a fresh lock, in which case they are left untouched.
54
54
 
55
+ ### Disconnected backup drives
56
+
57
+ The first backup to a directory creates it and writes a marker file, `.joplin-incremental-backup`. After that, the plugin refuses to back up to that directory if the marker is missing, instead of recreating the directory. This protects against an unmounted drive: without the check, a path like `/mnt/backup/joplin` would be recreated on the internal disk, the snapshots would go there, and they would be hidden under the mount point once the drive came back.
58
+
59
+ If you moved or deleted the backups on purpose, create an empty `.joplin-incremental-backup` file in the directory, or choose a different directory.
60
+
61
+ When upgrading from a version without the marker, the first backup adopts your existing backup directory. If that directory does not exist at that point but backups have been made before, the plugin assumes the drive is not mounted and refuses rather than creating it. If it really is a new location, create the directory yourself and the next backup will use it.
62
+
55
63
  ### Scheduler catch-up behaviour
56
64
 
57
65
  When Joplin starts, the plugin checks when the last successful backup finished:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joplin-plugin-incremental-backup",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "scripts": {
5
5
  "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
6
6
  "prepare": "npm run dist",
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 1,
3
3
  "id": "io.github.raytray.joplin-incremental-backup",
4
4
  "app_min_version": "3.7",
5
- "version": "1.0.2",
5
+ "version": "1.0.4",
6
6
  "name": "Incremental Backup",
7
7
  "description": "Deduplicated incremental snapshots of your Joplin data using the native Raw export format.",
8
8
  "author": "raytray",
@@ -11,8 +11,8 @@
11
11
  "keywords": [
12
12
  "backup"
13
13
  ],
14
- "platform": [
15
- "deskop"
14
+ "platforms": [
15
+ "desktop"
16
16
  ],
17
17
  "categories": [
18
18
  "files"
@@ -20,6 +20,6 @@
20
20
  "screenshots": [],
21
21
  "icons": {},
22
22
  "promo_tile": {},
23
- "_publish_hash": "sha256:ac4f78b1972925a5b3b55d0da17827f748d6a195ba187a2f2c2ca8a29d2607ee",
24
- "_publish_commit": "main:8a71e1debc8d2fd1e1ed14deb75efcfeb31bc006"
23
+ "_publish_hash": "sha256:a05c0de08c7351568246782a0ef6a0da310188eab923c72626231aa7b866359b",
24
+ "_publish_commit": "main:c56fbc960c9dd41f40acdd0fb75306177e1e28d8"
25
25
  }