The Humble Ledger: A Single Command for a Complete System Snapshot

We talk about backups in grand, architectural terms. We design systems for resilience, plan for disaster recovery, and invest in elegant, automated pipelines. But sometimes, the most powerful tool isn't a complex suite of software, but a moment of clarity captured in a single, deliberate action. I want to talk about one such command, a quiet ritual that has saved me more times than I care to admit.

It’s this: tar -czvf /backups/$(hostname)-$(date +%Y%m%d-%H%M).tar.gz --exclude=/backups --exclude=/proc --exclude=/tmp --exclude=/mnt --exclude=/dev --exclude=/sys --one-file-system / 2>/backups/backup-$(date +%Y%m%d).log

This isn't a replacement for your incremental, off-site, versioned backup strategy. It is its complement. This is the ledger you grab when the ship is listing, a complete, atomic snapshot of the system's state at a single moment in time. I run it manually, always, right before any significant operational shift: a major dependency update, a core configuration change, or the deployment of a new, intricate service.

The beauty is in its simplicity and its isolation. By excluding transient directories and ensuring we stay on the root filesystem, we get a clean, consistent tarball. The timestamped filename is our anchor point in history. The stderr redirect to a log file captures any warnings or permission issues, creating an audit trail for the snapshot itself.

Why do this when automated tools exist? Because this archive exists outside of any automation framework. It doesn’t require a database plugin, a special agent, or a cloud credential. It is a pure, unadulterated copy of the machine's soul at that moment. When a complex upgrade goes sideways and the machine is in a half-broken state, this tarball is a known-good baseline. You can extract a single configuration file from it with absolute certainty of its context. You can compare its structure against a failed state. It is a fixed point of reference in a sea of change.

I keep only a handful of these, the most recent before major events. They are my operational checkpoints. They require no special software to restore; just tar and a hope. It is the most boring, reliable piece of technology in my toolkit: a compressed collection of files and a timestamp. But in its humble existence, it carries the immense weight of certainty, a quiet promise that no matter how far we wander, we can always find our way back to the moment just before we leapt.

Notes & further reading

A few pages I came back to while writing this: