Anonymised case study based on real work. Business names and server details are withheld; no figures are claimed beyond what the systems showed.

The situation

One owner managed three virtual private servers for different businesses: one hosting several websites, a self-hosted database platform and a mail stack; one running a dedicated mail platform; and one supporting another company's operations. Backups existed in pieces, were taken by hand and were not checked. Nobody could say with confidence that a restore would work.

The approach

1. Health check first. Before any backup, each server was checked for pending updates, failed services, running containers and website responses, so backups captured a known-good state.

2. One script per server. Each server got its own backup script on the owner's computer. A script connects over SSH, dumps the PostgreSQL databases running in containers, archives application folders and configuration, and writes a single compressed archive.

3. Dated archives in one place.Archives land as dated files in one backups folder on the owner's machine.

4. Verify, then clean up. The script compares the SHA-256 checksum of the downloaded file with the server copy. Only when they match does it delete the temporary archive from the server, so servers do not fill up with old backups.

5. Respect permissions. Where a full backup needed administrator rights, the owner typed the password personally; the scripts never store passwords or keys.

The outcome

All three servers now have a repeatable backup routine that produces dated, checksum-verified archives off the servers, with temporary copies removed. The first full runs completed successfully for each server.

What others can reuse

FAQ

Is a local copy enough? It is a good first layer; a second copy in another location protects against loss of the local machine.

How often should backups run? It depends on how much change the business can afford to lose; databases usually need the most frequent backups.

I take on a small number of advisory and hands-on systems engagements each quarter. Connect at virender.in.

Image: Eric Gaba, CC BY-SA 3.0, via Wikimedia Commons (https://commons.wikimedia.org/wiki/File:Seagate_ST33232A_hard_disk_inner_view.jpg)