diff --git a/startos/backups.ts b/startos/backups.ts new file mode 100644 index 0000000..cf14630 --- /dev/null +++ b/startos/backups.ts @@ -0,0 +1,9 @@ +import { sdk } from './sdk' + +// Back up the "main" volume, which holds the SQLite database. StartOS stops the +// service for the duration of a backup (and restarts it afterwards only if it +// was running), so the database file is quiescent while it is copied and no +// separate snapshot hook is needed. See README.md — Backups and Restore. +export const { createBackup, restoreInit } = sdk.setupBackups( + async ({ effects }) => sdk.Backups.ofVolumes('main'), +)