added backup/restore to apps/photos/libre-photos

Added backup and restore guide
This commit is contained in:
ippocratis 2023-01-18 00:24:47 +02:00 committed by GitHub
parent 0630de150a
commit 4cadae6cb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,3 +143,30 @@ services:
container_name: librephotos-redis container_name: librephotos-redis
restart: unless-stopped restart: unless-stopped
``` ```
## Librephotos backuo/restore
Docker offers volumes so /data and /code/protected_media are safely mounted on host. Simply rsync backup of these dirs
posstgres db backup
Usefull to avoid a full scan
`docker ps`
Grab postgres container id e.g.40b12de38945
Backup
`docker exec -t your-db-container pg_dumpall -c -U your-db-user > dump_$(date +%Y-%m-%d_%H_%M_%S).sql`
A file like dump_20-11-2022_00_55_26.sql is created
Restore
`cat your_dump.sql | docker exec -i your-db-container psql -U your-db-user -d your-db-name`
*Note the -U dbuser (default is docker for librephotos)
and the -d bdname (default librephotos for librephotos)
Put that on a crontab
And there you go you have periodic db snapshots