Rotate your backups to save space and stay sane

Backups are critical to your business but the only thing worse than no backup is not being able to find the one you need!

Rotate your backups to manage files betterBackup rotation

A common practice is to “rotate” your backups. The term rotate probably comes from the days when a backup was done on a physical tape a bit like a VHS cassette (I’m assuming that at least some of you will have seen one of these!). It means that you reuse space by deleting or overwriting some previous backups.

If you have an eCommerce site then you will want at least a daily backup so that in the event of a disaster you only haven to manually recover a single day of transactions.

How many backups to I need?

The aim is to have a good selection of recent backups and still be able to recover data from months ago if needed. Balance this against having too many backups that take up too much space.

Let’s work through an example:

  • Let’s say you have a daily backup and that you do your cycle on a Friday:
    • Each Friday you delete the backups from the week before (not this weeks), keeping just the Friday. So you have Friday from last week and every day this week.
    • Next Friday you do this again, now you have all this weeks backups and the last 2 Fridays.
  • If you kept doing this forever then you could always get a backup from any day this week or within a week of the date you wanted from the older ones.

So in a year, instead of having 365 backups you would have 51+7=58 and you could still get to within a week of your data even a year ago.

The most common backup to need is a recent one. The likelihood of needing an earlier backup reduces over time so it is a balance of how many to keep against the resources needed to manage them.

  • Taking our example above a bit further, each month you can do what you did for each week.
    • Keep all the Friday backups for the last month but only keep the last Friday of the month for older ones.

Now at the end of the year instead of 365 backups you have 11+3+7=21, you can still get your data any day in the last week, any week in the last month and any month in the last year. All with only 21 files instead of 365.

You can guess how this then runs to the yearly cycle but even if you only went to monthly let’s look at 5 years of website data 5*356=1,825 vs 5*12+3+7=70 just a little over 3% of the size!

Is this backup strategy right for me?

This is just an example although it is also a really good starting point for the majority of businesses. You should always think about your own business and any legislative requirements for you to keep data that might influence how many backups you need to have. In any case you will probably find a variationĀ  of this system serves you well.

If the idea of spending your Friday deleting old backups makes you cry then remember that this is exactly the sort of thing that can be run automatically as a script.

In this simplified discussion I have not covered all the variations on backups by a long shot. If you are really keen then a short Google session will show you that there are incremental backups, snapshots and many other variations. The challenge is to balance all that you could possibly do against what you need to do in order to cover your risk.

Here’s to always having the backup you need available,

Brian
your ‘Peoples Geek’