this post was submitted on 09 Nov 2023
12 points (100.0% liked)

Aotearoa / New Zealand

1651 readers
19 users here now

Kia ora and welcome to !newzealand, a place to share and discuss anything about Aotearoa in general

Rules:

FAQ ~ NZ Community List ~ Join Matrix chatroom

 

Banner image by Bernard Spragg

Got an idea for next month's banner?

founded 1 year ago
MODERATORS
 

Welcome to today’s daily kōrero!

Anyone can make the thread, first in first served. If you are here on a day and there’s no daily thread, feel free to create it!

Anyway, it’s just a chance to talk about your day, what you have planned, what you have done, etc.

So, how’s it going?

you are viewing a single comment's thread
view the rest of the comments
[–] Dave@lemmy.nz 2 points 1 year ago* (last edited 1 year ago) (1 children)

Docker is fantastic but there is definitely a learning curve. I use docker compose for everything, which makes it easier (especially blowing away and recreating a container).

Instead of trying to work out where stuff lives, I create bind mounts. Basically, map a directory on your system to a directory within the container. Most self-hosted services these days will provide docker-compose.yml example files with bind mounts specified, and docker now ships with compose baked in.

I create one directory to hold everything, then one directory to hold a service, then put the docker-compose.yml file in there. Then I can back up just that one directory and everything important is backed up (I do things differently for lemmy because I want live backups, but all my personal stuff is done like that).

[–] d3Xt3r@lemmy.nz 2 points 1 year ago (1 children)

Just curious, how do you do live backups for Lemmy?

[–] Dave@lemmy.nz 2 points 1 year ago

Two parts. The first part is the important part, the database. I run a scheduled database dump for this (the lemmy documentation actually explains how to do a database dump and how to restore it - I just have a bash script triggered by a cron job).

The second part is the images. Uploaded images and the image cache (for thumbnails for posts on other servers, etc) are virtually impossible to tell apart, so it's all backed up (about 150GB just for images). For this, I just do a tarball of the whole directory. Any in-progress changes get skipped by the process but my theory is that since images are only added and deleted, if the process was run 30 seconds earlier then any being added would have been missed anyway, so they can wait until tomorrow's backup. The vast, vast majority are cached images rather than image uploads anyway.

These two things are done overnight NZ time as they can be resource intensive, but I've done daylight hour backups before when needed, and it doesn't cause much of an impact to the site performance anyway.