Raspberry Pi live backup over network?

I have a Raspberry Pi which is very hard to get to, its actually inside my Natural Gas generator, and takes 6 bolts and removing a large cover to get to

I want to take a full backup of this incase the SD card fails. What is the best way to do this? It seems there are not out the box tools like Veeam, as its ARM

1 Like

rsync is always the answer.

2 Likes
mkdir /mnt/nfs_bkp
mount.nfs nfs-server:/path/to/backup/location /mnt/nfs_bkp
rsync -avAX  / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/nfs_bkp/*","/media/*","/lost+found"} /mnt/nfs_bkp

Restoring is only a matter of formatting a new SD card, mounting the two Pi partitions (root and boot) and copying things over to it, unmounting and plugging into the pi. Of course, you can always just copy a file from the nfs server back to your pi if you missed something. This is a full backup obviously, so if you want backups of smaller things, like config files or logs from your generator, you have to do another rsync manually, more frequently.

2 Likes

Editing the etc/fstab to match the new partition IDs or UUIDs and then doing the rest.

Alternative if it is networked is net boot it and have all the stuff saved and backed up via your nas.

I used this in the end. Been doing daily backups for about a week now, working great

https://forums.raspberrypi.com/viewtopic.php?t=332000

Tested a few restores, 100% success. Just burn the .img file with Etcher and off to the races