backup
rigger backup [--keep N] [--list]Copies the database beside itself, stamped with the schema it holds and the moment it was taken, and deletes all but the newest few.
$ rigger backupCopied to C:\Users\you\AppData\Local\lacodda\rigger\data\profiles\line\rigger.v18-20260915-120253.bakKept the 10 newest, deleted 2 older copies.The copy goes through SQLite’s own backup interface rather than a file copy, so it is consistent even if something else has the database open.
With --json, taking a copy prints where it went and what rotation deleted; --list prints the copies.
| Field | Type | Meaning |
|---|---|---|
backup |
string | The path of the copy just taken. |
removed |
array | The older copies rotation deleted. |
removed[] |
string | The path of one deleted copy. |
backups |
array | The copies, newest first. |
backups[] |
object | One copy. |
backups[].path |
string | The copy’s path. |
backups[].taken_at |
string or null | The moment in the copy’s name, in RFC 3339 UTC; null when the name holds none. |
Keeping a few, not all
Section titled “Keeping a few, not all”--keep N sets how many copies survive; the default is 10. Rotation never deletes the copy it has just taken, so --keep 0 still leaves one.
$ rigger backup --keep 2Copied to ...\rigger.v18-20260915-120253.bakKept the 2 newest, deleted 2 older copies.--list shows what is there, newest first, without taking a copy:
$ rigger backup --list2 copies newest first: rigger.v18-20260915-120253.bak today rigger.v18-20260915-120252.bak todayThe age comes from the moment in the name, not from the file’s own timestamp: a copy that has been moved or restored carries a timestamp saying when it was moved, while the name still says when the record inside it was true. A file whose name holds no readable moment is listed as unknown rather than given a guessed age.
Automatically, at the end of a session
Section titled “Automatically, at the end of a session”The record is one file, and a sitting that has just been written down is the work most worth insuring. So session end takes a copy when the newest one predates today:
$ rigger session end riggerSession on rigger closed, open since 2026-09-15T08:02:11Z....copied the database to ...\rigger.v18-20260915-120253.bakA second sitting on the same day does not take another: today’s copy is insurance enough. A copy that cannot be written is reported, but does not fail the close - the session has already ended, and an error there would invite a second end on a record that has none open.
Before a migration, automatically
Section titled “Before a migration, automatically”A migration rewrites the record. So when a newer rigger opens a database written by an older one, it takes this same copy first and says where it went:
$ rigger doctorMigrating schema 1 -> 2; the previous database is saved as ...\rigger.v1-20260904-084102.bakA fresh database has nothing to lose and is not copied.
How old the newest copy is
Section titled “How old the newest copy is”doctor prints the age of the newest copy, and says so when it is old:
$ rigger doctor...backup: 3 days ago, 5 copies kept - older than a day; run `rigger backup`A copy from today passes without advice. Older than a day is worth a line; older than a week means the copy no longer resembles the record. No copy at all is named loudest: one file, and nothing behind it.
Restoring
Section titled “Restoring”A backup is an ordinary SQLite database. To go back to one, close anything using rigger and copy the file over rigger.db - the path doctor prints.