How to Archive Old Backups: Retention Policies That Save Disk Space

Backups pile up. A nightly job that nobody prunes will fill a small VPS disk in months, and the first sign is usually a failed backup at 3 am, or a database that cannot write because the disk is full. The fix is to archive old backups on a schedule, so the copies you need stay close and the copies you rarely need move somewhere cheaper.

Archiving is not deleting. It means moving older backups to slower, cheaper storage, and keeping a clear record of what lives where. A backup from last week should restore in minutes. A backup from last year can take an hour to fetch, because you will almost never need it. That trade is the whole point of retention: fast access where it matters, cheap storage where it does not.

Archive Old Backups: A Retention Plan That Works

A retention plan answers three questions: how many copies to keep, for how long, and where each age of copy lives. A simple plan that works for most small VPS setups is daily backups for 7 days, weekly backups for 4 weeks, and monthly backups for 12 months. That gives you 7 daily copies, 4 weekly copies, and 12 monthly copies, instead of 365 daily copies eating the disk.

The tiers map to real restore needs. A file deleted yesterday needs a daily copy. A database problem discovered two weeks after it happened needs a weekly copy. A legal or audit request from six months ago needs a monthly copy. Past a year, most small sites can drop to one copy per quarter, or delete the old copies entirely, as long as the decision is written down and someone agreed to it.

Write the plan down with numbers, not vague words. “Keep backups for a while” means nothing when the disk fills up. “Keep 7 daily, 4 weekly, 12 monthly” is a rule a script can follow, and a script is what should enforce it. Manual pruning is the kind of job that gets skipped for six months and then becomes an emergency.

Backup Retention Policy Basics

Start by measuring what you have. List the backup folder, sort by date, and add up the size per month. That total is the cost of the current habit, and it is the number the retention plan has to bring down. Most VPS owners are surprised by the result: the oldest six months often hold more data than the newest month, because the backups grew as the site grew.

Next, decide what each tier is for. Daily copies exist for fast recovery from recent mistakes. Weekly copies exist for problems discovered late. Monthly copies exist for the long tail: audits, disputes, and the rare case where data loss is found months after it happened. If a tier has no job, drop it. A monthly copy that nobody would ever restore is just disk space with a label.

Set the policy per data type, not per server. A database that changes every hour deserves more frequent copies than a folder of static images that never changes. The uploads folder can be backed up weekly and kept for months, while the database gets daily copies kept for weeks. Splitting the policy by data type is usually what frees the most space, because it stops the backup job from copying unchanged files every night.

Cold Storage Backups: Moving Old Copies Off the VPS

Once a backup is older than a few weeks, it does not need to live on the VPS. Move it to cold storage: an S3-compatible bucket, a second cheap VPS, or an external drive. The move is simple with rsync or a storage sync tool, and the savings are immediate, because the VPS disk is usually the most expensive storage you own.

Before you move anything, confirm the archive restores. Download one old backup from the new location, restore it on a test machine, and check the data. A copy that cannot be read back is not an archive, it is a hope. Test one archive from each storage location every few months, and test after every change to the storage setup.

Keep an index of what moved where. A small text file that lists each backup, its date, its size, and its location is enough. Without that index, finding a six-month-old backup becomes a search through buckets and folders at the worst possible time. The rsync backup tutorial for incremental server backups shows a sync pattern that keeps the newest copies on the server and pushes older ones to a second machine automatically.

Backup Archive Schedule: Automating the Tiers

Automate the tiering with a script that runs weekly. The script looks at the backup folder, keeps the newest 7 daily copies, promotes one copy per week to the weekly tier, and promotes one copy per month to the monthly tier. Everything else gets moved to cold storage or deleted, according to the plan. The script should log what it moved and deleted, so you can see the disk space it freed and check that it kept the right copies.

Tools can do this for you if you prefer not to write the script. BorgBackup has built-in pruning with exactly these rules: keep a number of daily, weekly, and monthly archives, and drop the rest. The BorgBackup setup guide covers the prune command and the retention flags, and deduplication means the copies it keeps cost far less disk than full copies would. Restic has a similar forget and prune flow, and the Restic tutorial for encrypted backups shows how to run it against S3-compatible storage.

Whatever tool you use, run the prune job on a schedule and watch its output. A prune job that fails silently leaves the disk filling up just as surely as no prune job at all. Log the job, alert on failure, and check the disk usage trend once a month. The trend line tells you whether the plan works: a flat line after pruning means the tiers are holding, and a rising line means something is growing faster than the plan allows.

How Much Disk Does Retention Actually Save?

The savings depend on how much the data changes, but the shape is the same for everyone. A site that backs up 10 GB every night holds 3.6 TB of copies after a year if nothing is ever pruned. With a 7 daily, 4 weekly, 12 monthly plan, the same site holds about 23 copies, and with deduplication or incremental backups the real disk use is far lower still, because most of those copies share the same unchanged data.

Mistakes That Undo a Good Retention Plan

The first mistake is pruning the only copy of something. Never let the archive script delete the last copy of a database or a folder. Keep at least one copy of everything in the monthly tier, and make the script refuse to delete the last archive of any data set. A script that prunes too eagerly is worse than no script at all.

The second mistake is archiving backups that were never tested. An old backup that cannot restore is not worth the storage it sits on, and moving it to cold storage does not make it better. Test the restore before the backup ages out of the fast tier, while it is still easy to make a fresh copy if the test fails.

The third mistake is keeping everything forever “just in case”. Storage is cheap, but a pile of unlabelled backups from three years ago is not an archive, it is clutter. It slows down restores, confuses the index, and costs money every month. Pick a maximum age, write it in the plan, and let the script enforce it.

Putting Your Retention Plan in Place

Start today with three steps. First, measure the backup folder and write down the total size. Second, write the retention rule in one line: 7 daily, 4 weekly, 12 monthly, older copies to cold storage. Third, set up the prune job and the move to cold storage, and put a monthly check on the calendar to review the disk trend.

Retention is not exciting work, but it is what keeps backups working. A backup system that fills its own disk stops backing up, and a backup system that stops backing up is the same as having no backups at all. A written plan, a script that enforces it, and a monthly check are all it takes to keep the disk clear and the restores possible.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.