I once had an agent check the server that runs dimetime, my budgeting app. In the backup folder it found 84 backup files with a size of zero bytes, from the three months before. The nightly job had written them at 03:00.
Each of those runs had failed. An earlier change had made the app hold an exclusive lock on its SQLite database. A backup taken while the app runs is then refused with database is locked, and the old script left an empty file behind anyway. The oldest of the empty files was three months old.
Four things a backup has to do
- Run without you. A scheduled job, every day.
- Fail loudly. A failed run must not look like a successful one.
- Leave the machine. A copy on the same server, or the same volume, disappears together with the database.
- Come back. Until you have restored one, you don’t know whether the files are usable.
The old dimetime job did the first and failed at the second. Since the fix the script checks the copy’s integrity before it keeps it, and exits with an error and no file if anything goes wrong.
Then I put the new job into my own user’s schedule (its crontab) instead of the administrator’s. My user isn’t allowed to talk to Docker on that server, so the 03:00 run would have failed again. A read-only check by the agent found that the same afternoon. A backup job is set up once you have seen the file from its first scheduled run.
What Kontura’s backup does
Kontura’s database is PostgreSQL on a rented server. One shell script backs it up, run by a timer every night.

Three details apply with any tools:
- The dump is encrypted with a public key before it touches the disk. The matching private key was made on my own machine and is not on the server, so the server can’t read its own backups. No backup can be restored without that key, so it is stored in two separate places.
- A failed dump, a missing key or a file under 4 KB fails the run and leaves no file behind.
- Old local copies are only removed at the end of a successful run, after the upload. A run that fails earlier deletes nothing.
After a successful run the script can ping a monitoring service, which alerts when the daily ping is missing. The backup jobs at my day job report the same way.
Why I can’t delete the off-site copy myself is in Can my AI agent delete my production database?
The restore drill
The evening the backup went live, I restored one. A second script starts an empty database in a throwaway container on my laptop, decrypts a backup file into it, prints the row count of every table and checks every stored invoice against its checksum chain. The run ended with:
1 organizations, 1 invoices verified, 0 failed
restore: RESTORE CHECK PASSED
Kontura’s runbook asks for a repeat every quarter and after changes to the backup setup, with a note of how long the restore took.
If a platform runs your database
The platform may back it up, depending on your plan. Supabase’s documentation says: “We automatically back up all Pro, Team, and Enterprise Plan projects on a daily basis.” For the free plan the same page recommends exporting the data yourself regularly. It also notes that database backups don’t include files stored through the Storage API.
A platform backup still needs a drill. Supabase’s “Restore to a new project” builds a separate project from a stored backup, but the copy includes the original’s scheduled jobs, and they start running as soon as it is restored. Use it only if you know those jobs can’t touch live services. The safer drill is an export loaded into a local database with no way out to the internet. It tests the export and your data, and leaves the stored backups untested.
Check your own app
Find last night’s backup and look at its date and its size. If the newest file is older than a day or only a few bytes long, or if you don’t know where to look, fix that before anything else on the checklist. A plausible date and size show that the job ran, and only a restore shows that the file is usable.
Then ask your agent for the full picture:
Find out how this app's database is backed up. Read code and configuration
only: do not change anything, run scripts, a backup or a restore, send
requests to live services or use production credentials. Report file names
and line numbers. Never show the value of a key, password or connection
string, not in quoted code or search output either.
1. What creates the backup, when, and where is the schedule defined?
2. Where do the copies go, and does one leave the server?
3. When a run fails, can it leave an empty or partial file, and would
anyone be told?
4. Can old copies be deleted before a new one is confirmed good?
5. Are uploaded files backed up too, or only the database?
Mark what you saw and what you inferred. Then write out, without running
them, the commands to restore the newest backup into a throwaway local
database with no connection to production, and to count the rows in each
table. Use placeholders for addresses, passwords and key files.
This post is part of the checklist in Is my vibe-coded app production-ready?