I’m using Hetzner, Netcup, and Linode for application, email, and DNS services. I’m looking for a reliable CLI-based backup solution that can back up entire machines or partitions and restore the backups easily within the same cloud or VPS. (in case of disaster or recovery)
I’m looking for a simple, beginner-friendly recommendation to create full backups of my machine or specific partitions, not just individual files.
Storage in Cloud/VPS: The backups should be stored either in attached volume or B2:BackBlaze
Easy Restoration: The backup should be easily restorable in case of failure or migration.
Tools;
I haven’t worked with any of these. Do they allow you to boot an ISO from any location on your own VM? If so, then use ReaR (Relax-and-Recover) combined with restic. Run a script that runs the rear mkrescue, then the restic backup, then delete the rear ISO from the local file system.
You’ll still need to back up your OS and data files (using restic), but the ReaR ISO will allow you to boot into a rescue environment which allows you to recreate the VM (it doesn’t save LVM block data, like snapshots, it only saves the LVM, BTRFS and other FS metadata about how the layout is configured and recreates it to the same parameters using the same UUIDs - if you want to back up the exact blocks from it, you’d need an offline backup utility like clonezilla).
I personally don’t use ReaR, I prefer to backup my full FS and if I need to, recreate the partition layout (it’s extremely rare that your disk layout craps out, it’s almost always OS files, like libraries or corrupted / incomplete initramfs that make the system unbootable, which means you can just rm -rf /mnt/original-root-fs/* in a live environment, then copy the data from the backup into it).
Even more so, if you’re dealing with corrupted libraries, it’s almost always easier to chroot into your old OS and fix it there, than to run a full restore (disk and all). At worst, if you can’t fix it in 10 minutes, get out of your chroot, do the rm of the rootfs and then restore the backup.