diff options
Diffstat (limited to 'content/posts/2021-11-14-backups.smd')
-rw-r--r-- | content/posts/2021-11-14-backups.smd | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/content/posts/2021-11-14-backups.smd b/content/posts/2021-11-14-backups.smd new file mode 100644 index 0000000..396dcb3 --- /dev/null +++ b/content/posts/2021-11-14-backups.smd @@ -0,0 +1,17 @@ +--- +.title = "Backups", +.author = "Martin Ashby", +.date = @date("2021-11-14T11:12:44Z"), +.layout = "single.shtml", +.custom = {"comments": true}, +--- + +I've recently setup a full system backup for my raspberry pi home server, backing up to my NAS over NFS. Working backups give me the confidence to use it for more critical things like email, calendar and contacts. + +I've used [restic](https://github.com/restic/restic) as it does convenient, password-encrypted, differential backups to a variety of backends. + +I've set it up with a systemd timer to trigger it. The script I've written shuts down all services so the file system isn't changing too much underneath while the backup is working, mounts the backup location, does the backup, then unmounts the backup again before restarting the rest of the system. I think it's important to disconnect the backup location during normal operation to prevent damage to backups should some bad command run, like `rm -rf /`. + +I've tested restoring the whole system to a new SD card, and while it's not perfect, it does work with only minor adjustments after restore. + +In future I'll probably copy the backup to an offsite system like [backblaze B2](https://www.backblaze.com/b2/cloud-storage.html), or I'll set up an arrangement with a friend who also has some space on a NAS and a decent 'net connection. I'll also configure restic to prune old backups to save on space. |