Expand description
Snapshots of the library metadata.json in backup/, kept the way Eagle
keeps them, and recovery from them when metadata.json is damaged.
Eagle copies metadata.json to backup/backup-YYYY-MM-DD HH.mm.ss.SSS.json
(local time) when the library changed and every 30 minutes. It skips the
copy when the newest backup has the same size, refuses to back up a file
that doesn’t parse or lacks applicationVersion, and keeps at most 100
backups. On open, a metadata.json that fails to parse is replaced by the
newest backup that parses and has a modificationTime; the damaged file
is kept as backup/metadata.json.damaged-<ms>.
Eagle also keeps one more copy outside the library, in its app data:
eagle-backup/<hash>.json, where <hash> is the 32-bit FNV-1a hash of
the library path (no trailing slash) over its UTF-16 code units, as 8
lowercase hex digits (app_data_backup_name). It replaces that copy
whenever it writes a new backup into an existing backup/ list (not
for the very first one); falcon replaces it with every new backup.
Nothing is written for a library whose folder is gone, so a backup
never recreates a moved or deleted library.
Constants§
- MAX_
BACKUP_ COUNT - Most backups Eagle keeps; older ones are deleted.
Functions§
- app_
data_ backup_ name - The name of the app-data copy of the library at
root:<fnv1a-32 of the path>.json, as Eagle names it. - backup_
library Library::backup_metadatafor the library atroot, without opening it. It only readsmetadata.jsonand writes intobackup/, so the app runs it on a background thread while the library stays in use: ametadata.jsoncaught mid-write doesn’t parse and is skipped.- backup_
library_ with backup_library, also replacing the library’s copy inapp_backups(the app’seagle-backupfolder, created if needed) whenever a new backup is written. A failure there is ignored, as Eagle ignores it.- backup_
name - The file name Eagle gives a backup taken at
time(local time), e.g.backup-2026-10-26 02.15.25.310.json.