ImmichI
Immich7mo ago
Jgahbs

Confusion over database dump -- permission denied?

Hi, I'm hoping you can help me with a permissions issue. I am trying to do a manual database dump backup , but something's wrong with my permissions. I get permission denied, even though immich_postgres is root. I don't understand permissions very well. It's possible I gave the parent folders incorrect permissions. What do I have wrong here? Here is what I am trying to do and what I see as a result:

john@raspberrypi:/mnt/ssd$ sudo docker exec -u root -t immich_postgres pg_dumpall --clean --if-exists --username=postgres | gzip > "/mnt/ssd/immich-backup/dump.sql.gz"
-bash: /mnt/ssd/immich-backup/dump.sql.gz: Permission denied
john@raspberrypi:/mnt/ssd$ ls -ld /mnt/ssd/library /mnt/ssd/postgres /mnt/ssd/immich-backup/
drwxr-xr-x 2 root root 4096 May 21 20:52 /mnt/ssd/immich-backup/
drwxr-x--- 8 root root 4096 Feb 8 05:54 /mnt/ssd/library
drwx------ 21 999 root 4096 Jun 3 02:52 /mnt/ssd/postgres
john@raspberrypi:/mnt/ssd$ sudo docker exec -it immich_postgres whoami
root

(These returned nothing):
john@raspberrypi:/mnt/ssd$ sudo dmesg | grep -i denied
john@raspberrypi:/mnt/ssd$ sudo docker exec -it immich_postgres ps aux | grep postgres
john@raspberrypi:/mnt/ssd$

Thanks very much for any pointers.
Was this page helpful?