All things

Preservation Monitor

A real-time file change monitoring system for the MDAH preservation storage array, replacing two legacy tools with a single lightweight service.

Preservation Monitor

Preservation Monitor watches the NFS-mounted preservation storage array for file changes in real time using inotifywait, recording every creation, deletion, and rename to both daily audit logs and a PostgreSQL database. It correlates paired move events into single rename records, buffers writes for efficient batch inserts, and gracefully handles database outages by continuing to log to disk and retrying on reconnect. A reconcile mode provides full filesystem inventory scans for disaster recovery scenarios. It replaced two older systems — a bash audit script and a complex multi-server ZFS snapshot pipeline involving TrueNAS cron jobs, Redis queues, and an Ubuntu processing server — with a single Python service managed by systemd. The result is a simpler, more reliable audit trail for long-term digital preservation accountability.

Tech Stack

Python PostgreSQL