The perfect Backup
This is, of course, subjective. It depends on your personal needs. I have the following requirements:
- I have a Raspberry Pi 5 as a home server.
- My clients are exclusively Windows PCs.
I have developed the following procedure for myself:
- I back up my data to USB hard drives (no streamers, tape libraries, etc.).
- Since my clients are exclusively Windows PCs, I back them up at the share level, i.e., each root directory that my Windows clients see is backed up separately (but several or all of them can be backed up on one disk).
- But the Linux environment also needs to be backed up so that I don't have to set it up from scratch in the event of a catastrophic failure.
- I use the hardware requirements as described in my Raspberry Pi GreenNas article. The scripts under Downloads (not available yet, this is a preview!) use the hardware extensions.
The initial situation
I have one server that handles everything. The 1 TB server disk (SSD), including home directories and other daily-use disks, is online 24/7. The NAS and backup disks are automatically connected and mounted as needed and are accessible to all scripts.
I have an encrypted partition (which is relatively large) on my server disk. To avoid having to copy it via dd every time, it is mounted on the backup disk and synchronized only at the file level. This requires entering the password during backup, so it cannot be done automatically (e.g., overnight).
The backup disk can be smaller than the NAS plus the server. It must already contain every share to be backed up (at least as an empty directory). This allows you to use leftover disks as backup media for one or more shares that fit on it.
It is therefore advisable to log every backup. I do this automatically in a database in the backup script. This way, I can always see which disk contains the most recent backup of a share, or which shares haven't been backed up in a while, which I'll need to do soon.
The backup disk is identified by its UUID, has a unique name in the database, and is labeled with this name (and the UUID, just to be sure).