How to backupAugust 18, 2021 | Philosophy
Backup is often a messy business, we are allways told to backup. But, what is a backup really and what is the purpose of the backup?
There are many aproaches to these questions, and how could you decide what the right aproach is for your circumstances?
In th "old days" there used to be a tendency towards making a full backup, some times of the whole system, daily, weekly, monthly, yearly. But, we have a lot of data these days and storrage is still relative expensive. So, it seems like a very ressouce heavy approach to backup. Due to several reasons I would not recommend this approach in general. Only where vital infrastructure, that is to complex to reconstruct in a reasonably timeframe is present this should be an option.
Differential and incremental backup
Are a better approach to limit to amount of storage needed. Here only changes to the original full backup is added to the backup.
In the post "Rclone setup on Raspberry Pi" there is an approach to a sync solution, that saves the old file when a file is syncronised.
What to backup
Most people just backup everything, often complete disk images. In my take this is a dangerous way of doing backup, first of this is very resource heavy and time consuming. So, there will be a tendancy to not doing backup as often. There will also be a tendency not to test the backup, and a lot of stuff can go wrong when backing up a running system. It may not be straight up and running, after recovery due to file rights and running processes during the backup.
How I do
Keeping system files and data files separated! Figure out what is the important data, that you don't want to loose. Usually these are files like documents and photos, and code if you are a developer.
What about all my systems? Systems should not be a big cloudy mess, a very important part of backup is to know your infrastructure in a way where you could reconstruct it fast. There many ways to do that, some of my methods for that are:
- Having a list of my nessesary applications, system settings and the changes made thru time and OS version.
- Network infrastructure (backup of firewall settings) a diagram, where everything is described like subnet and static IP's for devices.
- Use of Ansible to automate some processes (and backup of these files).
Another great side effect of this methode can be, the you get rid of a lot of unnessesary applications, libraries and in case of malware you don't carry this over from a backup.