How Should Server Backups Actually Be Done? The Distance Between "Backed Up" and "Restorable"
2026-10-17 07:24:38
When a server goes down, what breaks people is never "having no backup" — it's "having backed up, only to discover at recovery time that the backup is useless."
The disk dies; you pull out the backup and find it lived on the same machine in the same rack as the dead disk — gone together. Ransomware hits; the backup directory, kept in sync with production, gets encrypted along with everything else. The database breaks; the dump you pull out is six months old — the backup job had been silently failing for months and nobody knew. And the most galling case of all: the backups are fine, but nobody can articulate the recovery steps, and after four hours of trying the system still isn't up while the business waits.
With backups, 90% of the effort goes into the "backing up," yet 100% of the value shows up in the "restoring." This article walks through disaster recovery in practical order: what to back up, how, where to put it, and how to verify — every step something you can actually check on the ground.

I. First Settle Two Numbers: How Much Can You Lose, How Long Can You Stop
Before doing anything, answer two questions; the answers determine how the backup plan is built:
First: how much data can you afford to lose? Is losing a day acceptable, or at most an hour? The database holds customer orders and production records; for most shops the answer is "at most ten-odd minutes to an hour." That answer directly determines backup frequency — a once-a-day scheme loses a full day at worst, which doesn't match a "at most one hour" requirement.
Second: how long can you afford to be down? If the business system collapses, is recovering within half a day acceptable, or must it come back up in minutes? The answer decides whether the plan needs a "last trump card" (say, a full-disk image or a standby machine ready to switch to at any time).
Write these two numbers on paper and the backup plan rarely goes off track. Everything discussed below is configured around these two constraints — how much you can lose and how long you can stay down. Talk about backups without these numbers and it easily becomes the self-comfort of "copy everything, every day."
Here's a common way to arrive at the numbers; if it fits, take it as your own: a machining shop of twenty to thirty people runs orders, work orders, and production records, and the owner's bottom line is "losing a morning's data is indefensible to customers, and being down a day means no business." Working backward: the database must retain a recovery point at least every hour (enable log archiving), file data syncs once a day, and after a total machine failure the system must be back within four hours (so you need another machine that can take over and a backup fresh enough). Once these two numbers are set, every layer that follows exists to honor them — backup frequency, retention policy, drill cadence all follow. Conversely, if a shop answers "this data could be re-entered if lost, and being down three days doesn't matter," the plan can be as simple as one weekly full backup plus one off-site copy — no heavy machinery needed. There is no standard answer for a plan; there is only whether it matches the business.
II. What to Back Up: Data, Configuration, and the Easily Missed Items
Many shops' backups do exactly one thing: export the database. Only when recovery time actually comes do they discover a laundry list of missing pieces. A complete checklist falls into three categories:
Category one: business data — the most critical, but the method matters.
Databases must be backed up logically with official export tools (pg_dump for PostgreSQL, mysqldump for MySQL); do not copy the data directory directly. While a database is running, its data files are in constant flux, and what you copy is a "front-and-back inconsistent" file — at recovery time it may error out at best or refuse to start at worst. If you need physical-level backup, freeze a snapshot first, then copy (more below).
Besides the database there are file-type data: uploaded drawings, attachments, images. These usually live scattered in some directory; confirm each one and list it.
Category two: configuration — the most time-consuming to lose.
Reinstalling the system takes an hour, but restoring the configuration can take three days. What to back up: modified configs under /etc (nginx, firewall rules), crontab entries, custom systemd units, SSL certificates and private keys, SSH authorized_keys, and the application's config files and environment variables (note: files containing passwords must be stored encrypted).
Category three: the runtime environment — the key to faster recovery.
Code versions, runtime versions, dependency manifests, container orchestration files. The scariest recovery failure is "installed a new version, won't run." Recording version information (or freezing it in containers) can cut recovery time by more than half.
Conversely, some things don't need backing up: logs (retain enough for your window), caches, temporary files. Sort the list by weight, and backup size and duration stay controllable — this is also why many shops' backup jobs eventually fail quietly when the disk fills up.
III. How to Back Up: Pick the Right Method — Don't Turn Every Screw with One Hammer
1. Combining full and incremental backups.
Full backups are simplest to restore (one file does it) but large and slow; incrementals only capture changes, saving space, but must be stacked in order at recovery. The common practical combination: one full backup weekly plus daily incrementals, with a tiered retention policy — every one of the last 7 days, one per week for the last 4 weeks, one per month for the last 12 months. Keeping multiple copies isn't just about preventing loss; it's about preventing "a bad version overwriting a good one": data gets accidentally deleted one day, and the next backup captures the "post-deletion state" — with only one copy, the mistake becomes permanent.
2. File-level sync: rsync.
The workhorse for directory-type data (attachments, configs, code). Incremental transfer, excludable directories, and with the --link-dest parameter it can produce "a snapshot a day, without duplicate files taking space." One caution: use rsync's --delete parameter with great care — if a file is mistakenly deleted in production, a sync with --delete will delete it from the backup too; this is the classic way "a sync drive is not a backup."
3. Database consistency: snapshot first, then copy.
When you want physical-level speed and consistency, use LVM snapshots (or cloud disk snapshots): freeze the volume at a consistent point in time, then copy from the snapshot. Databases have their own finer trick: with binlog/WAL archiving enabled, scheduled dumps plus log replay can restore to any moment in the day — lifesaving for "I dropped a table and want it back."
4. Full-disk images: the last trump card.
A dd full-disk image can reproduce the entire system verbatim onto a new disk — suitable as a low-frequency fallback (say, quarterly), not a daily routine: slow, space-hungry, and a running system's image has the same consistency problem, so do it in a maintenance window or with snapshots.
5. Cloud server snapshots: convenient, but don't rely on them alone.
Cloud platform snapshots are one click to enable and genuinely convenient. But see their boundary clearly: snapshots usually live in the same cloud account and region as the host — account compromised, region-level outage, snapshot policy accidentally disabled — and the snapshots vanish together. Cloud snapshots can be one layer of the plan, never the whole thing.
6. Automation and alerting: silent failure is the most dangerous.
Run all backup jobs on crontab or systemd timers, but they must be paired with alerting: job failure, output file much smaller than expected, several days with no new file — each must proactively reach a human. A backup job nobody watches failing for three months is the norm — that's exactly how the "six-month-old dump" at the top of this article happened.
Assemble these pieces and a typical small-shop plan looks roughly like this:
1 a.m.: scheduled database export (full dump); after export, check the file size against expectations, notify on anomaly. 2 a.m.: incremental sync of file directories to the backup machine, add-only, never delete. 3 a.m.: push the night's dump and changed files to off-site object storage with versioning enabled. Every Friday: copy that week's full backup to an offline disk, unplug it, lock it in a cabinet. First Saturday of each month: a light drill — import the latest dump into a test environment and check the data. Every quarter: a full drill — bring up another machine, restore the entire system from backup, and record how long it took.
A one-line task list taped next to the server states who owns each step and whom to call when it fails — the entire difficulty of disaster recovery is not technical; it's that somebody owns it and somebody looks at it regularly.
IV. Where to Store It: the 3-2-1 Rule and Ransomware Defense
3-2-1 in one sentence: keep 3 copies of important data, on 2 different media, with 1 copy off-site.
For a small shop's reality, that's roughly:
Copy 1: another disk or directory on the same machine — protects against accidental deletion, not against total machine failure. Copy 2: another machine (a standby server or NAS in the same room) — protects against single-machine failure. Copy 3: off-site — sync to another server in another location, or push to object storage (one rclone command; costs a few yuan a month).
Ransomware defense is the soul of 3-2-1, and it has two hard rules:
One: the backup account's permissions must be one-way. Production machines may write to the backup side, but the backup side must never be able to modify or delete production — actually, the correct direction: the backup endpoint accepts writes but production can't erase what's stored there. When ransomware gets production credentials, its first move is to follow that connection and encrypt or wipe the backups too. Versioning on object storage, tightened permissions on backup directories, and a backup account without delete rights all implement this idea.
Two: keep one copy out of reach. Regularly (say, weekly) copy critical data to an offline disk, unplug it, and lock it away. Offline media is the endpoint neither ransomware nor accidental deletion can reach — it's not networked, not mounted, and nobody can encrypt it.
V. A Backup Never Test-Restored Equals No Backup
This is the most important section of the whole article.
A backup file sitting there does not mean it can be restored. Corrupt files, lost passwords, mismatched versions, missing certificates, recovery steps nobody knows — each must be discovered before a real incident. So run regular recovery drills; the method isn't complicated:
Step one: pick a low-traffic period and another machine (even an old PC or a temporary cloud host) and restore the latest backup completely.
Step two: actually bring the system up after restoring: services start, pages open, login works.
Step three: spot-check the data: are the latest records there, and correct — restoring to three-day-old data is "technically successful, business-wise a failure."
Step four: record the elapsed time: from start of recovery to business-usable — that's your true "downtime length." If a drill takes two hours, a real incident takes at least that — knowing this number tells you whether to shorten the drill cycle or upgrade the plan.
Drills almost always expose problems. Common ones: the dump file was corrupted long ago; only a departed employee knows the database password; new-version dependencies don't match the old backup; the certificate private key was never backed up. Every problem found in a drill costs an afternoon; found in a real incident, it costs days of downtime.
Finally, write the recovery steps on one sheet of paper: which services start in what order, where passwords and keys live, whom to confirm with. When something breaks at midnight, nobody has time to flip through fifty pages of documentation.
A word of expectation for shops that have never drilled: the first drill almost certainly snags, and usually not on the backup file itself. The typical chain — you get the backup file and find the extraction password is known only to a departed network admin; the database imports but the app can't connect, because the config still points at the old machine's address; services start but pages won't open, because the certificate private key was never backed up; finally everything works, you check the data — and it's a five-day-old backup, with the four days in between long since failed. The whole chain surfacing takes an afternoon — but that is precisely the drill's value: every one of these landmines could stretch a real recovery from hours into days. After the first drill, fix each exposed problem one by one; the second goes much smoother; by the third, restoring from zero to business-usable within two hours, your backup system is genuinely standing.
VI. The Most Common Misconceptions
"Backups on another disk of the same server are safe." Machine stolen, motherboard fried, ransomware encrypts the whole system — the other disk goes with it. Copies must live on another machine.
"Cloud snapshots mean I don't need backups." Snapshots share the account and region; account compromise or misoperation can take them all — and a snapshot is not an independently restorable recovery point. A snapshot is a layer, not a plan.
"The backup job is still running, so all is well." Running is not succeeding — with a full disk it may fail every day, and the export file may be a few hundred bytes. Watch results and alerts, not the job's existence.
"Copying the data directory backs up the database." Copying a running database's files directly very likely won't start at recovery. Use official export tools, or snapshot first then copy.
"A sync drive/cloud drive is a backup." Sync is mirroring: production deletions and encryption replicate to the sync side. Sync is fine to have, but you must also have versioned, one-way backups.
"The more copies, the better." Unlimited retention without a tiering policy ends with a full disk and failed jobs — harming the whole backup system. Follow the 7-day/4-week/12-month tiers.
"I'll set up backups when this busy spell ends." A backup's value shows before the incident — you never know which day it comes, and corrupted data has no "next time."
VII. This Can Be Handed to Professionals
Disaster recovery setup is a classic short-term, one-shot project: first define the two numbers against the business (how much can be lost, how long can you stop), then produce the plan (what to back up, how, where, retention policy), then implement the configuration and run one full recovery drill, and finally deliver a one-page recovery manual — a clear start and end, accepted upon completion.
Our own core business system at Moges (production management software) has run on Linux for fourteen years; we've built and verified this backup-and-restore machinery one server at a time across hundreds of manufacturing customers. We do disaster recovery in exactly the order of this article: set the two numbers first, configure the three tiers of copies, and close with a live-fire recovery drill — whether a backup is reliable isn't judged by whether you backed up, but by whether it works on the day you need it.
For why a production system is worth building on Linux, see why the system has run on Linux from day one; for bringing a production system back in minutes after a midnight crash, see how to bring a production system back online in minutes after a midnight outage; for what to do first when a server is compromised, see Linux server hardening and incident response — backups are the expanded chapter of the "last line of defense" in that response. For the scope of disaster recovery as a short-term service, see the Linux server services introduction.
Closing
Backups, stripped to the bone, are three sentences:
Be thorough about what to back up — list data, configuration, and environment in three categories; use export tools for databases, never copy directories. Be clear about where to put it — layer with 3-2-1, keep the backup endpoint write-only from production, and hold one offline copy. Practice the restore — an un-drilled backup equals no backup, and every problem a drill finds is a landmine defused early.
Servers and data have no default state of "all is well" — only "what you hold in your hands on the day it breaks." Backup is the one thing done now, used later, and impossible to patch once it's needed — it deserves a slot on this month's calendar, not a spot in the "when I have time" pile.