[plug] Backup of linux computer to cloud VM that can be remoted into in the case of failure?

Brad Campbell brad at fnarfbargle.com
Tue Oct 25 21:45:19 AWST 2022


On 24/10/22 17:51, Daniel wrote:
> Hi
> Is it possible to setup a Backup of linux computer to cloud VM that can be remoted into in the case of failure?
> 
> How might this be done? 
> What file system setup and which cloud provider might work? 
> 
> Thank you 
> 
> Daniel 

I run 2 servers here, a primary and backup.

Both are vaguely similar in hardware config, but I use a kernel on the primary that can cope with both.
I use a periodic rsync on all the filesystems. I have a script on the backup that does a couple of things.
- It creates a tgz of specific config files, such as /etc/network/interfaces /etc/fstab /etc/mdadm/mdadm.conf.. and so on.
- It then makes all those files immutable
- Rsync all filesystems
- Remove the immutable bits

Job done. 

The only exception is at time of a major OS upgrade where underlying library or binaries change significantly. At that time, I force a restart after the rsync.
The only other time I restart is if a config change may have impacted the boot process, or the backup needs to go live.

It's all automated, so the backup is never more than a couple of hours behind the prod server.

As long as all the mount points line up and the network interfaces are named appropriately everything "just works" (tm).

Did it take a _long_ time to get right? Absolutely. I've only had to use it in anger once, when I had a RAM failure on the primary.

Biggest benefit?  It gets used *often* to test upgrades or new software before rolling out, because I can do major system upgrades, script, test and then just run the sync script to wipe them back to scratch. Last major OS update I did on the primary was probably tested 30 times on the secondary over several months until I had a script that would run it flawlessly, patch the config files and bring everything back up without operator interaction.

Brad


More information about the plug mailing list