How to backup
Often i hear things like
"I don't have space for backups" or "I don't know how to do backups".
Do you think that the theif, fire, ransomware or accidental deletion cares about that?
There's one person and one person only responisble for your backups. That's you!
The question you need to ask yourself is; do i have any data that i care about?
Photos, configs, code etc? If not, well this guide isn't for you. But if you do; here's some advice.
General backup advice
- Encrypt any data leaving your house.
- Automate your backups.
- Do incremental backups.
The 3-2-1 method with an addition of 1-0
There's a method called 3-2-1 which is a pretty good start, you can add 1-0 to it to make it even better.
This means
3 copies of your data
2 different medias
1 offsite
1 offline
0 errors on your restore tests
What does this mean? Let's break it down.
3 copies of your data
"If your data doesn't exist in three copies it doesn't exist at all".
The three types of data here is
The orignal data - copy 1
The backup data - copy 2
The disaster recovery data - copy 3
2 different medias
Meaning that you do not keep your copies on the same media. The media in this case could be a HDD, internal or external, USB drive, NAS etc.
Remember - RAID is not a backup.
1 offsite
Offsite means outside of your house. This is a worst case scenario backup.
What does this protect you from?
Fire, floods, tornados, theft etc.
Note: some data might not be worth sending offsite. That's entirely up to you.
Maybe you backup your entire machine with an image backup for easy restore. Maybe your entire image file is 500GB. Worth having on a onsite separate media, but not offsite?
1 offline
Offline meaning offline for real, not connected to anything.
It could be an exteral HDD or USB drive that you regularly plug in and copy your backup set to. Enterprise still use good ol' tapes.
What does this protect your from?
Malicious code like ransomware.
0 errors on your restore tests
Backups are no good if you can't restore them.
Do regular restore tests from all your backup copies, even those that are offsite and offline.
Verify that the files you restore aren't corrupt and that they are working as intended.
That's the 3-2-1-1-0 method. These are minimum, you can of course have even more copies offsite and offline backups if you want to.
Services
For offsite backups, send it to a friend, parents, cloud, whatever. Just make sure that it's encrypted.
B2 Backblaze - Pay as you go, really cheap.
Hetzner Storage Box - Up to X TB.
I use both of these. Multiple offsite backups isn't a bad idea.
Applications and commands
Veeam is an enterprise VM backup solution but they also have free agents for Windows and Linux. This is perfect for complete image backups of any Windows or Linux machine.
It doesn't matter if it's virtual or physical, a server or a desktop, Veeam does it all.
I've used Veeam for more than ten years. It's a really reliable, fast and efficient backup solution.
Restic is a backup program that is fast, efficient and secure. It supports the three major operating systems (Linux, macOS, Windows) and a few smaller ones (FreeBSD, OpenBSD).
Autorestic is a wrapper around the amazing restic. While being amazing the restic cli can be a bit overwhelming and difficult to manage if you have many different locations that you want to backup to multiple locations. This utility is aimed at making this easier.
rsync - A really powerful utility built into Linux.
To sync a directory onsite to an offsite location and keeping the content identical between the directories you could use
rsync -avz /home/user/mybackupdata user@remotelocation:/myremotebackuppath/ --progress --delete
If you just want to copy the content without deleting on the remote site, just remove the --delete
rsync -avz /home/user/mybackupdata user@remotelocation:/myremotebackuppath/ --progress
Note; this doesn't encrypt anything. Encrypt your data prior to sending it offsite.
Todo
Add examples for different use cases
Add my backup setup