my-backup: B2 + Log Encoding Fixes
Section titled “my-backup: B2 + Log Encoding Fixes”Date: 2026-06-11
Repo: D:\FSS\Software\Utils\PythonUtils\my_backup
What happened
Section titled “What happened”B2 backup failed with rclone exit 7. Non-ASCII characters reported in backup.log.
Root causes
Section titled “Root causes”B2 failure
Section titled “B2 failure”rclone sync creates B2 “hide markers” (soft delete) instead of permanently deleting files. These hidden versions count toward B2 storage. After 3 months of daily Kopia maintenance:
- Local Kopia repo: 5.1 GB
- B2 bucket: 10.1 GB (5 GB was accumulated hidden versions)
Hit the 10 GB free-tier Daily Storage Cap → B2 blocked uploads → rclone exit 7.
Non-ASCII in log (two sources)
Section titled “Non-ASCII in log (two sources)”✓/✗(U+2713/U+2717):PlainTextFormatterstripped Rich markup tags but passed Unicode chars through unchanged\x85(cp1252 ellipsis): monthly cron runs viacmd.exein cp1252 context, stdout redirected tobackup.log
Fixes applied
Section titled “Fixes applied”| Fix | File | Change |
|---|---|---|
--b2-hard-delete | tasks.py | Permanent deletes on B2 — no more hide markers |
| rclone stderr logging | tasks.py | Log rclone error output on failure (not just exit code) |
| Unicode→ASCII in log | utils.py | PlainTextFormatter replaces ✓→[OK], ✗→[X] |
| PYTHONUTF8=1 in cron | crontab | Forces UTF-8 for all monthly cmd.exe backup runs |
One-time cleanup
Section titled “One-time cleanup”Ran rclone cleanup :b2:fss-backup-mirror → purged 5 GB of hidden versions.
B2 bucket: 10.1 GB → 5.133 GB. Daily backups green as of 2026-06-11.
Belt-and-suspenders
Section titled “Belt-and-suspenders”B2 lifecycle rule set to expire hidden versions after 2 days.
Verified
Section titled “Verified”[2026-06-11 08:00:59] INFO ✓ Backblaze B2 (Active): Synced Successfully
[2026-06-11 10:58:22] INFO [OK] Backblaze B2 (Active): Synced Successfully (post-fix)
Non-ASCII bytes in log after fix: 0
Docs updated
Section titled “Docs updated”CHANGELOG.md: v1.5.0LESSONS.md: 4 new entries (B2 versioning, PYTHONUTF8, rclone stderr, PlainTextFormatter)