The problem
Scanned bills, contracts, tax records and identity documents all sat on one NAS and nowhere else. A single hardware failure or a house fire would have taken every copy.
What I built
- SourceDocument systemRead through a view-only account
- Backup hostBackup scriptDaily and weekly timers
- EncryptSensitive items and the full exportPassword held only in a password manager
- DestinationGoogle DriveNarrow, app-only access
The backup produces three things, each for a different need:
| What | Form | For |
|---|---|---|
| Everyday documents | Readable PDFs, filed by folder | Finding one document from a phone |
| Identity documents | One encrypted archive | Keeping the most sensitive items unreadable in the cloud |
| Full system export | Encrypted, weekly, last 8 kept | Rebuilding the whole system |
Design decisions
1. The backup reads through a view-only account
The script signs in as a dedicated user that can view documents and change nothing. Access is granted through a group, so a future read-only integration joins the group instead of collecting its own one-off permissions.
2. A missing permission stops the run
A view-only account has a quiet failure mode: a new document it can't see is simply absent from the backup. The script checks for that and fails the run, and an automatic rule grants the group access to every new document. An incomplete backup is reported as a failure, not delivered as a success.
3. The cloud connection is as narrow as it can be
The upload uses my own Google sign-in client with a scope limited to the files the backup itself creates. It can't read anything else in the Drive account.
4. Silence is treated as failure
Each successful run leaves a time stamp. A daily health check alerts if the daily stamp is older than 36 hours or the weekly one older than 200 hours, which catches a job that has stopped running without ever reporting an error.
The restore drill
- I started a clean, throwaway copy of the document system on a different machine.
- I decrypted the latest weekly export and imported it into the clean copy.
- I compared every document against the live system, by the checksum of the original file and by its extracted text.
All 58 documents matched exactly. The counts of tags, correspondents, document types and folders matched too. The throwaway copy was removed afterwards, and the drill repeats quarterly.
While building this I found that the archive tool's “test with password” command quietly accepted an empty password and reported success. The first version of my archive check would have passed no matter what. I rewrote it to supply the password a different way, so the check can fail when it should.
What I would do next
- Keep to the quarterly drill. One passed restore proves the process worked once.