#BACKUP_DIR points to file or folder with insufficient permissions

1 messages · Page 1 of 1 (latest)

languid iris
#

I'm trying to set up a custom directory the automatic backup for the database, but it's not working, and only giving me the error shown in the title when I check the logs.

Here is what I have in my docker-compose file for the db-dumper container:

  backup:
    container_name: immich_db_dumper
    image: prodrigestivill/postgres-backup-local:14
    restart: always
    env_file:
      - .env
    environment:
      POSTGRES_HOST: database
      POSTGRES_CLUSTER: 'TRUE'
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      SCHEDULE: "@daily"
      POSTGRES_EXTRA_OPTS: '--clean --if-exists'
      BACKUP_DIR: /media/backup/db_dumps
    volumes:
      - ./db_dumps:/db_dumps
    depends_on:
      - database

volumes

What should I do to fix this?

royal willowBOT
#

:wave: Hey @languid iris,

Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich immich.

References

Checklist

  1. :ballot_box_with_check: I have verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: I have read applicable release notes.
  3. :ballot_box_with_check: I have reviewed the FAQs for known issues.
  4. :ballot_box_with_check: I have reviewed Github for known issues.
  5. :ballot_box_with_check: I have tried accessing Immich via local ip (without a custom reverse proxy).
  6. :ballot_box_with_check: I have uploaded the relevant logs, docker compose, and .env files, making sure to use code formatting.
  7. :ballot_box_with_check: I have tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable

(an item can be marked as "complete" by reacting with the appropriate number)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

vernal parrot
#

What do you mean custom directory? You just need to adjust the volume as required

languid iris
#

so I just change the volumes thing to the same directory as BACKUP_DIR?

#

i want the dumps to save in an external ssd im using

vernal parrot
#

./db_dumps:/db_dumps

The desired on-location path needs to replace ./db_dumps

languid iris
#

alright

#

i changed - ./db_dumps:/db_dumps to - /media/backup/db_dumps/:db_dumps and the same error is still there

hallow geyser
#

Did you run docker compose up -d?

languid iris
#

yes

hallow geyser
#

You’ll need to fix the permissions on your external drive then

#

Try 777

languid iris
#

that didnt work

#

i ran chmod -R 777 /media/backup

vernal parrot
#

Can you show the error?

#

I'm guessing you didn't create the folder

languid iris
#

i did

#

this is the error im getting

#

this is everything in my ssd

#

the dump that is already there was created manually

vernal parrot
#

Oh my bad. I didn't notice you modified the original snippet from the website. I don't know how you're using backupdir

hallow geyser
#

My bad

languid iris
#

is backup_dir not supposed to be changed?

#

the docs werent exactly clear on what to do if i want it to go in a different location other than where the docker compose file is

vernal parrot
#

Use the original code block from the immich website, then adjust as mentioned above. Let us know how that goes

languid iris
#

alright

#

ok the error is gone

#

it didnt back up yet but i assume itll do that at some point before the day is over if there is no more problems

vernal parrot
#

It might only do it once a day as default. I forget what the default settings are. Within 24 hours you should see a backup

languid iris
#

ok good

#

thanks

#

i will close this now since the problem seems to be fixed