this post was submitted on 14 Jul 2023
665 points (95.5% liked)

Fediverse

28223 readers
555 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to [email protected]!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration), Search Lemmy

founded 1 year ago
MODERATORS
 

The fanbase is still large, but the Lemmy community hasn't quite caught up yet, and now there is a transitional period where the audience is smaller.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 year ago (1 children)

this is the bash script I use to create backups

#! /bin/bash
# https://join-lemmy.org/docs/administration/backup_and_restore.html#a-sample-backup-script
now=$(date +"%Y-%m-%d_%H.%M.%S")

cd ~/lemmy && (docker-compose exec -T postgres pg_dumpall -c -U lemmy 1> dump.sql 2> dump.errors)
cd ~/lemmy && zip -r9 ~/bak-lemmy-$now.zip ./ --exclude "volumes/postgres/*"
rm -f ~/lemmy/dump.sql

it creates very small zip files as a result so it's very efficient

I made a cron for it to run every 3 hours, like

0 */3 * * * ~/lemmy/backup.sh
[–] [email protected] 1 points 1 year ago (1 children)

I figured out how to do this with docker container, but that's not ideal for a script.

Using docker compose it just fails with: Service "postgres" is not running container #1

I can see lemmy-easy-deploy if I do: docker compose ls

The service name is postgres in the docker-compose.yml file. Any idea what the issue might be?

[–] [email protected] 0 points 1 year ago (1 children)

Where is this lemmy-easy-deploy? I haven't seen that before, maybe if I read how it works I can figure out what's wrong

[–] [email protected] 1 points 1 year ago (1 children)
[–] [email protected] 1 points 1 year ago (1 children)

I think you might just need to change the cds to go into the correct directory where the active docker-compose.yml file is, which should be in the folder called live

[–] [email protected] 1 points 1 year ago

Sadly, no. That's already where I was running it.